diff --git a/Source/CustomAvatar/Resources/Assets b/Source/CustomAvatar/Resources/Assets index ff64f52a..57190717 100644 Binary files a/Source/CustomAvatar/Resources/Assets and b/Source/CustomAvatar/Resources/Assets differ diff --git a/Source/CustomAvatar/Resources/README.md b/Source/CustomAvatar/Resources/README.md deleted file mode 100644 index 115efb31..00000000 --- a/Source/CustomAvatar/Resources/README.md +++ /dev/null @@ -1,11 +0,0 @@ -# Embedded Resources -This folder contains various resources used by Custom Avatars. - -## icon.png -This is simply the mod icon used by BSIPA. It is referenced in the `manifest.json` file at the root of this project. - -## shaders.assets -This file contains shaders used by Custom Avatars. Note that this does not contain shaders required to load avatars – shaders are included in avatar asset bundles and do not need to be loaded separately. This asset bundle is generated through this repo's Unity project. - -## ui.dds -This file contains various UI elements. It is a DXT5 compressed DDS file that can be edited using [GIMP](https://www.gimp.org/) and should be exported with mip map generation enabled. Note that this image is flipped vertically because [Unity uses the DirectX convention while basically everything else (e.g. Windows, GIMP, Blender) uses the OpenGL convention](https://developer.blender.org/T59867). The coordinate system when looking at this flipped image has its origin in the top-left corner; for example, the mystery man icon starts at (256, 0) and has a size of (256, 256). \ No newline at end of file diff --git a/Source/CustomAvatar/Resources/ui.dds b/Source/CustomAvatar/Resources/ui.dds deleted file mode 100644 index 2f7cfa51..00000000 Binary files a/Source/CustomAvatar/Resources/ui.dds and /dev/null differ diff --git a/Source/CustomAvatar/UI/AvatarListViewController.cs b/Source/CustomAvatar/UI/AvatarListViewController.cs index 2ea605d0..39f3404c 100644 --- a/Source/CustomAvatar/UI/AvatarListViewController.cs +++ b/Source/CustomAvatar/UI/AvatarListViewController.cs @@ -17,7 +17,6 @@ using System; using System.Collections.Generic; using System.IO; -using System.Reflection; using System.Threading; using System.Threading.Tasks; using CustomAvatar.Avatar; @@ -29,6 +28,7 @@ using Polyglot; using TMPro; using UnityEngine; +using UnityEngine.U2D; using UnityEngine.UI; using Zenject; @@ -46,6 +46,7 @@ internal class AvatarListViewController : ViewController, TableView.IDataSource private PlayerOptionsViewController _playerOptionsViewController; private LevelCollectionViewController _levelCollectionViewController; private PlatformLeaderboardViewController _leaderboardViewController; + private AssetLoader _assetLoader; private FileSystemWatcher _fileSystemWatcher; private TableView _tableView; @@ -53,14 +54,13 @@ internal class AvatarListViewController : ViewController, TableView.IDataSource private readonly List _avatars = new(); private AvatarListTableCell _tableCellPrefab; - private Texture2D _atlas; private Sprite _blankAvatarSprite; private Sprite _noAvatarSprite; private Sprite _reloadSprite; private Sprite _loadErrorSprite; [Inject] - internal void Construct(ILogger logger, PlayerAvatarManager avatarManager, DiContainer container, MirrorViewController mirrorViewController, PlayerOptionsViewController playerOptionsViewController, LevelCollectionViewController levelCollectionViewController, PlatformLeaderboardViewController leaderboardViewController) + internal void Construct(ILogger logger, PlayerAvatarManager avatarManager, DiContainer container, MirrorViewController mirrorViewController, PlayerOptionsViewController playerOptionsViewController, LevelCollectionViewController levelCollectionViewController, PlatformLeaderboardViewController leaderboardViewController, AssetLoader assetLoader) { _logger = logger; _avatarManager = avatarManager; @@ -69,28 +69,16 @@ internal void Construct(ILogger logger, PlayerAvatarMa _playerOptionsViewController = playerOptionsViewController; _levelCollectionViewController = levelCollectionViewController; _leaderboardViewController = leaderboardViewController; + _assetLoader = assetLoader; } protected void Start() { - using (Stream fileStream = Assembly.GetExecutingAssembly().GetManifestResourceStream("CustomAvatar.Resources.ui.dds")) - { - _atlas = SimpleDdsLoader.LoadImage(fileStream); - _noAvatarSprite = Sprite.Create(_atlas, new Rect(0, 0, 256, 256), new Vector2(0.5f, 0.5f)); - _blankAvatarSprite = Sprite.Create(_atlas, new Rect(256, 0, 256, 256), new Vector2(0.5f, 0.5f)); - _reloadSprite = Sprite.Create(_atlas, new Rect(0, 256, 128, 128), new Vector2(0.5f, 0.5f)); - _loadErrorSprite = Sprite.Create(_atlas, new Rect(256, 256, 256, 256), new Vector2(0.5f, 0.5f)); - } - } - - protected override void OnDestroy() - { - Destroy(_noAvatarSprite); - Destroy(_blankAvatarSprite); - Destroy(_reloadSprite); - Destroy(_atlas); - - base.OnDestroy(); + SpriteAtlas atlas = _assetLoader.uiSpriteAtlas; + _noAvatarSprite = atlas.GetSprite("NoAvatarIcon"); + _blankAvatarSprite = atlas.GetSprite("BlankAvatarIcon"); + _reloadSprite = atlas.GetSprite("ReloadButtonIcon"); + _loadErrorSprite = atlas.GetSprite("LoadErrorIcon"); } protected override async void DidActivate(bool firstActivation, bool addedToHierarchy, bool screenSystemEnabling) diff --git a/Source/CustomAvatar/Utilities/AssetLoader.cs b/Source/CustomAvatar/Utilities/AssetLoader.cs index 3ebc4c80..93d5039f 100644 --- a/Source/CustomAvatar/Utilities/AssetLoader.cs +++ b/Source/CustomAvatar/Utilities/AssetLoader.cs @@ -20,6 +20,7 @@ using System.Threading.Tasks; using CustomAvatar.Logging; using UnityEngine; +using UnityEngine.U2D; using Zenject; using Object = UnityEngine.Object; @@ -38,6 +39,8 @@ internal AssetLoader(ILogger logger) internal Shader unlitShader { get; private set; } + internal SpriteAtlas uiSpriteAtlas { get; private set; } + public void Initialize() { LoadAssetsAsync().ContinueWith((task) => _logger.LogCritical(task.Exception), TaskContinuationOptions.OnlyOnFaulted); @@ -47,6 +50,7 @@ public void Dispose() { Object.Destroy(stereoMirrorShader); Object.Destroy(unlitShader); + Object.Destroy(uiSpriteAtlas); } private async Task LoadAssetsAsync() @@ -80,6 +84,10 @@ private async Task LoadAssetsAsync() unlitShader = (Shader)asset; break; + case "assets/sprites/ui.spriteatlasv2": + uiSpriteAtlas = (SpriteAtlas)asset; + break; + default: _logger.LogError($"Unexpected asset '{name}'"); break; diff --git a/Source/CustomAvatar/Utilities/SimpleDdsLoader.cs b/Source/CustomAvatar/Utilities/SimpleDdsLoader.cs deleted file mode 100644 index 1ff0d2db..00000000 --- a/Source/CustomAvatar/Utilities/SimpleDdsLoader.cs +++ /dev/null @@ -1,171 +0,0 @@ -// Beat Saber Custom Avatars - Custom player models for body presence in Beat Saber. -// Copyright © 2018-2023 Nicolas Gnyra and Beat Saber Custom Avatars Contributors -// -// This library is free software: you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation, either -// version 3 of the License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with this program. If not, see . - -using System; -using System.IO; -using System.Runtime.InteropServices; -using System.Text; -using UnityEngine; - -namespace CustomAvatar.Utilities -{ - internal static class SimpleDdsLoader - { - /// - /// Loads a DDS file from a stream. Supports DXT1 and DXT5 compression. - /// - /// Stream that contains the DDS file. - /// A new containing the image. - public static Texture2D LoadImage(Stream textureStream, bool linear = false) - { - // DDS header: https://docs.microsoft.com/en-us/windows/win32/direct3ddds/dds-header - byte[] headerBytes = new byte[128]; - textureStream.Read(headerBytes, 0, headerBytes.Length); - - var handle = GCHandle.Alloc(headerBytes, GCHandleType.Pinned); - DdsHeader header; - - try - { - header = Marshal.PtrToStructure(handle.AddrOfPinnedObject()); - } - finally - { - handle.Free(); - } - - if (header.signature != "DDS ") - { - throw new IOException("Invalid file signature"); - } - - if (header.size != 124) - { - throw new IOException("Invalid header length"); - } - - if (!header.flags.HasFlag(DdsFlags.Caps) || !header.flags.HasFlag(DdsFlags.Height) || !header.flags.HasFlag(DdsFlags.Width) || !header.flags.HasFlag(DdsFlags.PixelFormat)) - { - throw new IOException("Invalid DDS header flags"); - } - - if (header.ddsPixelFormat.size != 32) - { - throw new IOException("Invalid pixel format length"); - } - - if (!header.ddsPixelFormat.flags.HasFlag(DdsPixelFormatFlags.FourCC)) - { - throw new IOException("Only compressed textures are supported"); - } - - int mipMapCount = 0; - - if (header.flags.HasFlag(DdsFlags.MipMapCount)) - { - mipMapCount = header.mipMapCount; - } - - string fourCC = header.ddsPixelFormat.fourCC; - - TextureFormat textureFormat = fourCC switch - { - "DXT1" => TextureFormat.DXT1, - "DXT5" => TextureFormat.DXT5, - _ => throw new IOException($"Unsupported DDS compression format '{fourCC}'"), - }; - - var texture = new Texture2D(header.width, header.height, textureFormat, mipMapCount, linear); - - byte[] textureBytes = new byte[textureStream.Length - headerBytes.Length]; - textureStream.Read(textureBytes, 0, textureBytes.Length); - - texture.LoadRawTextureData(textureBytes); - texture.Apply(); - - return texture; - } - - [StructLayout(LayoutKind.Sequential, Size = 128, CharSet = CharSet.Ansi)] - private struct DdsHeader - { - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)] private byte[] _signature; - public int size; - public DdsFlags flags; - public int height; - public int width; - public int pitchOrLinearSize; - public int depth; - public int mipMapCount; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 11)] public int[] reserved; - public DdsPixelFormat ddsPixelFormat; - public int caps; - public int caps2; - public int caps3; - public int caps4; - public int reserved2; - - public string signature - { - get => Encoding.ASCII.GetString(_signature); - set => _signature = Encoding.ASCII.GetBytes(value); - } - } - - [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Size = 32)] - private struct DdsPixelFormat - { - public int size; - public DdsPixelFormatFlags flags; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)] private byte[] _fourCC; - public int rgbBitCount; - public int rBitMask; - public int gBitMask; - public int bBitMask; - public int aBitMask; - - public string fourCC - { - get => Encoding.ASCII.GetString(_fourCC); - set => _fourCC = Encoding.ASCII.GetBytes(value); - } - } - - [Flags] - private enum DdsFlags : int - { - Caps = 0x1, - Height = 0x2, - Width = 0x4, - Pitch = 0x8, - PixelFormat = 0x1000, - MipMapCount = 0x20000, - LinearSize = 0x80000, - Depth = 0x800000 - } - - [Flags] - private enum DdsPixelFormatFlags : int - { - AlphaPixels = 0x1, - Alpha = 0x2, - FourCC = 0x4, - RGB = 0x40, - YUV = 0x200, - Luminance = 0x20000 - } - } -} diff --git a/Unity/BuiltInAssets/Assets/Scripts/Editor/ExportCustomAvatarsAssetBundle.cs b/Unity/BuiltInAssets/Assets/Scripts/Editor/ExportCustomAvatarsAssetBundle.cs index deb1d9b0..0d41ac56 100644 --- a/Unity/BuiltInAssets/Assets/Scripts/Editor/ExportCustomAvatarsAssetBundle.cs +++ b/Unity/BuiltInAssets/Assets/Scripts/Editor/ExportCustomAvatarsAssetBundle.cs @@ -21,6 +21,7 @@ public static void BuildAssetBundle() assetNames = new[] { "Assets/Shaders/StereoRender.shader", "Assets/Shaders/UnlitOverlay.shader", + "Assets/Sprites/UI.spriteatlasv2", }, }; diff --git a/Unity/BuiltInAssets/Assets/Sprites.meta b/Unity/BuiltInAssets/Assets/Sprites.meta new file mode 100644 index 00000000..5f4bb214 --- /dev/null +++ b/Unity/BuiltInAssets/Assets/Sprites.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: dc12732f3b42d9f4cb209178dd733ac9 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/BuiltInAssets/Assets/Sprites/BlankAvatarIcon.png b/Unity/BuiltInAssets/Assets/Sprites/BlankAvatarIcon.png new file mode 100644 index 00000000..e5da68a7 Binary files /dev/null and b/Unity/BuiltInAssets/Assets/Sprites/BlankAvatarIcon.png differ diff --git a/Unity/BuiltInAssets/Assets/Sprites/BlankAvatarIcon.png.meta b/Unity/BuiltInAssets/Assets/Sprites/BlankAvatarIcon.png.meta new file mode 100644 index 00000000..0d874a50 --- /dev/null +++ b/Unity/BuiltInAssets/Assets/Sprites/BlankAvatarIcon.png.meta @@ -0,0 +1,123 @@ +fileFormatVersion: 2 +guid: 33fb2764997cece42ab0bbce9991d7ad +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 12 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMasterTextureLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 1 + wrapV: 1 + wrapW: 1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 0 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + cookieLightType: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Server + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: 5e97eb03825dee720800000000000000 + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/BuiltInAssets/Assets/Sprites/LoadErrorIcon.png b/Unity/BuiltInAssets/Assets/Sprites/LoadErrorIcon.png new file mode 100644 index 00000000..aacdf6ba Binary files /dev/null and b/Unity/BuiltInAssets/Assets/Sprites/LoadErrorIcon.png differ diff --git a/Unity/BuiltInAssets/Assets/Sprites/LoadErrorIcon.png.meta b/Unity/BuiltInAssets/Assets/Sprites/LoadErrorIcon.png.meta new file mode 100644 index 00000000..eb46b2d9 --- /dev/null +++ b/Unity/BuiltInAssets/Assets/Sprites/LoadErrorIcon.png.meta @@ -0,0 +1,123 @@ +fileFormatVersion: 2 +guid: 13a28c1ac759bf344ba6b8f095fb11b5 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 12 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMasterTextureLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 1 + wrapV: 1 + wrapW: 1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 0 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + cookieLightType: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Server + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: 5e97eb03825dee720800000000000000 + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/BuiltInAssets/Assets/Sprites/NoAvatarIcon.png b/Unity/BuiltInAssets/Assets/Sprites/NoAvatarIcon.png new file mode 100644 index 00000000..06d9a578 Binary files /dev/null and b/Unity/BuiltInAssets/Assets/Sprites/NoAvatarIcon.png differ diff --git a/Unity/BuiltInAssets/Assets/Sprites/NoAvatarIcon.png.meta b/Unity/BuiltInAssets/Assets/Sprites/NoAvatarIcon.png.meta new file mode 100644 index 00000000..a29c4d11 --- /dev/null +++ b/Unity/BuiltInAssets/Assets/Sprites/NoAvatarIcon.png.meta @@ -0,0 +1,123 @@ +fileFormatVersion: 2 +guid: 8ad80b79c01954b41a1480cdfbcc00af +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 12 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMasterTextureLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 1 + wrapV: 1 + wrapW: 1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 0 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + cookieLightType: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Server + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: 5e97eb03825dee720800000000000000 + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/BuiltInAssets/Assets/Sprites/ReloadButtonIcon.png b/Unity/BuiltInAssets/Assets/Sprites/ReloadButtonIcon.png new file mode 100644 index 00000000..7aa83152 Binary files /dev/null and b/Unity/BuiltInAssets/Assets/Sprites/ReloadButtonIcon.png differ diff --git a/Unity/BuiltInAssets/Assets/Sprites/ReloadButtonIcon.png.meta b/Unity/BuiltInAssets/Assets/Sprites/ReloadButtonIcon.png.meta new file mode 100644 index 00000000..2136eb7d --- /dev/null +++ b/Unity/BuiltInAssets/Assets/Sprites/ReloadButtonIcon.png.meta @@ -0,0 +1,123 @@ +fileFormatVersion: 2 +guid: 445436fae0399de4689eabc517b4a6a6 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 12 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMasterTextureLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 1 + wrapV: 1 + wrapW: 1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 0 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + cookieLightType: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Server + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: 5e97eb03825dee720800000000000000 + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/BuiltInAssets/Assets/Sprites/UI.spriteatlasv2 b/Unity/BuiltInAssets/Assets/Sprites/UI.spriteatlasv2 new file mode 100644 index 00000000..681fb3d5 --- /dev/null +++ b/Unity/BuiltInAssets/Assets/Sprites/UI.spriteatlasv2 @@ -0,0 +1,43 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!612988286 &1 +SpriteAtlasAsset: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: + m_MasterAtlas: {fileID: 0} + m_ImporterData: + serializedVersion: 2 + textureSettings: + serializedVersion: 2 + anisoLevel: 1 + compressionQuality: 50 + maxTextureSize: 2048 + textureCompression: 0 + filterMode: 1 + generateMipMaps: 0 + readable: 0 + crunchedCompression: 0 + sRGB: 1 + platformSettings: [] + packingSettings: + serializedVersion: 2 + padding: 4 + blockOffset: 1 + allowAlphaSplitting: 0 + enableRotation: 1 + enableTightPacking: 0 + enableAlphaDilation: 0 + secondaryTextureSettings: {} + variantMultiplier: 1 + packables: + - {fileID: 2800000, guid: 33fb2764997cece42ab0bbce9991d7ad, type: 3} + - {fileID: 2800000, guid: 13a28c1ac759bf344ba6b8f095fb11b5, type: 3} + - {fileID: 2800000, guid: 8ad80b79c01954b41a1480cdfbcc00af, type: 3} + - {fileID: 2800000, guid: 445436fae0399de4689eabc517b4a6a6, type: 3} + bindAsDefault: 1 + isAtlasV2: 1 + cachedData: {fileID: 0} + m_IsVariant: 0 diff --git a/Unity/BuiltInAssets/Assets/Sprites/UI.spriteatlasv2.meta b/Unity/BuiltInAssets/Assets/Sprites/UI.spriteatlasv2.meta new file mode 100644 index 00000000..7a19b51c --- /dev/null +++ b/Unity/BuiltInAssets/Assets/Sprites/UI.spriteatlasv2.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: eda4221660709f742939e413482ed63b +SpriteAtlasImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/BuiltInAssets/Packages/manifest.json b/Unity/BuiltInAssets/Packages/manifest.json index cd8dab0b..1e74713d 100644 --- a/Unity/BuiltInAssets/Packages/manifest.json +++ b/Unity/BuiltInAssets/Packages/manifest.json @@ -1,5 +1,9 @@ { "dependencies": { + "com.unity.2d.sprite": "1.0.0", + "com.unity.ide.rider": "3.0.27", + "com.unity.ide.visualstudio": "2.0.22", + "com.unity.ide.vscode": "1.2.5", "com.unity.xr.management": "4.4.0", "com.unity.xr.mock-hmd": "1.3.1-preview.1", "com.unity.modules.assetbundle": "1.0.0" diff --git a/Unity/BuiltInAssets/Packages/packages-lock.json b/Unity/BuiltInAssets/Packages/packages-lock.json index 8f107256..6418f744 100644 --- a/Unity/BuiltInAssets/Packages/packages-lock.json +++ b/Unity/BuiltInAssets/Packages/packages-lock.json @@ -1,5 +1,54 @@ { "dependencies": { + "com.unity.2d.sprite": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.ext.nunit": { + "version": "1.0.6", + "depth": 1, + "source": "registry", + "dependencies": {}, + "url": "https://packages.unity.com" + }, + "com.unity.ide.rider": { + "version": "3.0.27", + "depth": 0, + "source": "registry", + "dependencies": { + "com.unity.ext.nunit": "1.0.6" + }, + "url": "https://packages.unity.com" + }, + "com.unity.ide.visualstudio": { + "version": "2.0.22", + "depth": 0, + "source": "registry", + "dependencies": { + "com.unity.test-framework": "1.1.9" + }, + "url": "https://packages.unity.com" + }, + "com.unity.ide.vscode": { + "version": "1.2.5", + "depth": 0, + "source": "registry", + "dependencies": {}, + "url": "https://packages.unity.com" + }, + "com.unity.test-framework": { + "version": "1.1.31", + "depth": 1, + "source": "registry", + "dependencies": { + "com.unity.ext.nunit": "1.0.6", + "com.unity.modules.imgui": "1.0.0", + "com.unity.modules.jsonserialize": "1.0.0" + }, + "url": "https://packages.unity.com" + }, "com.unity.xr.legacyinputhelpers": { "version": "2.1.10", "depth": 1, @@ -37,6 +86,12 @@ "source": "builtin", "dependencies": {} }, + "com.unity.modules.imgui": { + "version": "1.0.0", + "depth": 2, + "source": "builtin", + "dependencies": {} + }, "com.unity.modules.jsonserialize": { "version": "1.0.0", "depth": 2, diff --git a/Unity/BuiltInAssets/ProjectSettings/EditorSettings.asset b/Unity/BuiltInAssets/ProjectSettings/EditorSettings.asset index 1e44a0a1..cdc18140 100644 --- a/Unity/BuiltInAssets/ProjectSettings/EditorSettings.asset +++ b/Unity/BuiltInAssets/ProjectSettings/EditorSettings.asset @@ -4,27 +4,41 @@ EditorSettings: m_ObjectHideFlags: 0 serializedVersion: 11 - m_ExternalVersionControlSupport: Visible Meta Files m_SerializationMode: 2 m_LineEndingsForNewScripts: 0 m_DefaultBehaviorMode: 0 m_PrefabRegularEnvironment: {fileID: 0} m_PrefabUIEnvironment: {fileID: 0} - m_SpritePackerMode: 0 + m_SpritePackerMode: 5 m_SpritePackerPaddingPower: 1 + m_Bc7TextureCompressor: 0 m_EtcTextureCompressorBehavior: 1 m_EtcTextureFastCompressor: 1 m_EtcTextureNormalCompressor: 2 m_EtcTextureBestCompressor: 4 m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd;asmdef;rsp;asmref m_ProjectGenerationRootNamespace: - m_CollabEditorSettings: - inProgressEnabled: 1 m_EnableTextureStreamingInEditMode: 1 m_EnableTextureStreamingInPlayMode: 1 m_AsyncShaderCompilation: 1 + m_CachingShaderPreprocessor: 1 + m_PrefabModeAllowAutoSave: 1 m_EnterPlayModeOptionsEnabled: 0 m_EnterPlayModeOptions: 3 - m_ShowLightmapResolutionOverlay: 1 + m_GameObjectNamingDigits: 1 + m_GameObjectNamingScheme: 0 + m_AssetNamingUsesSpace: 1 m_UseLegacyProbeSampleCount: 0 m_SerializeInlineMappingsOnOneLine: 1 + m_DisableCookiesInLightmapper: 0 + m_AssetPipelineMode: 1 + m_RefreshImportMode: 0 + m_CacheServerMode: 0 + m_CacheServerEndpoint: + m_CacheServerNamespacePrefix: default + m_CacheServerEnableDownload: 1 + m_CacheServerEnableUpload: 1 + m_CacheServerEnableAuth: 0 + m_CacheServerEnableTls: 0 + m_CacheServerValidationMode: 2 + m_CacheServerDownloadBatchSize: 128