diff --git a/Assets/_DDD/_Scripts/AssetPostprocessors/AssetPostProcessors.cs b/Assets/_DDD/_Scripts/AssetPostprocessors/AssetPostProcessors.cs index dd547e1fb..a2682ead5 100644 --- a/Assets/_DDD/_Scripts/AssetPostprocessors/AssetPostProcessors.cs +++ b/Assets/_DDD/_Scripts/AssetPostprocessors/AssetPostProcessors.cs @@ -21,6 +21,10 @@ private void OnPreprocessTexture() { AssetPostprocessorSprite.OnPreprocessTexture(importer); } + else if (upperPath.Contains(PathConstants.RawOnlyAtlasPathUpper)) + { + AssetPostprocessorSprite.OnPreprocessTextureOnlyAtlas(importer); + } } public static void OnPostprocessAllAssets(string[] importedAssets, string[] deleteAssets, string[] movedAssets, diff --git a/Assets/_DDD/_Scripts/AssetPostprocessors/AssetPostprocessorSprite.cs b/Assets/_DDD/_Scripts/AssetPostprocessors/AssetPostprocessorSprite.cs index 19c4c5a73..974aade3b 100644 --- a/Assets/_DDD/_Scripts/AssetPostprocessors/AssetPostprocessorSprite.cs +++ b/Assets/_DDD/_Scripts/AssetPostprocessors/AssetPostprocessorSprite.cs @@ -68,6 +68,17 @@ public static void OnPreprocessTextureForUi(TextureImporter importer) importer.SetTextureSettings(textureSettings); } + + public static void OnPreprocessTextureOnlyAtlas(TextureImporter importer) + { + if (importer.textureType == TextureImporterType.Sprite) + { + return; + } + + importer.textureType = TextureImporterType.Sprite; + importer.spriteImportMode = SpriteImportMode.Single; + } private static void TryApplyPivotAfterImport(string path) { @@ -129,7 +140,8 @@ public static void OnRemove(string path, string movePath) var upperPath = path.ToUpper(); bool isValid = (upperPath.Contains(PathConstants.RawSpritesPathUpper) || - upperPath.Contains(PathConstants.RawUiPathUpper)) + upperPath.Contains(PathConstants.RawUiPathUpper) || + upperPath.Contains(PathConstants.RawOnlyAtlasPathUpper)) && upperPath.Contains(ExtenstionConstants.PngExtensionUpper); if (!isValid) return; @@ -145,7 +157,8 @@ public static void OnAdd(string path) var upperPath = path.ToUpper(); bool isValid = (upperPath.Contains(PathConstants.RawSpritesPathUpper) || - upperPath.Contains(PathConstants.RawUiPathUpper)) + upperPath.Contains(PathConstants.RawUiPathUpper) || + upperPath.Contains(PathConstants.RawOnlyAtlasPathUpper)) && upperPath.Contains(ExtenstionConstants.PngExtensionUpper); if (!isValid) return; diff --git a/Assets/_DDD/_Scripts/Utilities/Constants.cs b/Assets/_DDD/_Scripts/Utilities/Constants.cs index e88c08066..fa7c07891 100644 --- a/Assets/_DDD/_Scripts/Utilities/Constants.cs +++ b/Assets/_DDD/_Scripts/Utilities/Constants.cs @@ -37,6 +37,7 @@ public static class PathConstants { public const string RawSpritesPathUpper = "ASSETS/_DDD/_RAW/SPRITES/"; public const string RawUiPathUpper = "ASSETS/_DDD/_RAW/UI/"; + public const string RawOnlyAtlasPathUpper = "ASSETS/_DDD/_RAW/ONLYATLAS/"; public const string RawFolderPath = "/_Raw"; public const string AddressablesFolderPath = "/_Addressables"; } @@ -47,4 +48,11 @@ public static class ExtenstionConstants public const string PngExtensionLower = ".png"; public const string SpriteAtlasExtenstionLower = ".spriteatlasv2"; } + + public static class TextureImportConstants + { + public const string Processed = "processed"; + public const string Force = "force"; + public const string Skip = "skip"; + } } \ No newline at end of file