Created
March 16, 2024 07:13
-
-
Save kxn4t/9e9b24a1cd0cbad290f63710742ce1a4 to your computer and use it in GitHub Desktop.
UnityでAsset import時にCrunch圧縮のみを強制的に解除してimportするEditor拡張
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEditor; | |
namespace kxn4t.gist | |
{ | |
internal class DisableCrunchCompressionPreprocessor : AssetPostprocessor | |
{ | |
private void OnPreprocessTexture() | |
{ | |
TextureImporter textureImporter = (TextureImporter)assetImporter; | |
var settings = textureImporter.GetDefaultPlatformTextureSettings(); | |
if (settings.crunchedCompression) | |
{ | |
settings.crunchedCompression = false; | |
textureImporter.SetPlatformTextureSettings(settings); | |
UnityEngine.Debug.Log(textureImporter.assetPath + ": Crunch compression was forced disabled!"); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
おそらくUnity2022の場合、導入時になぜか既存のテクスチャに対しても処理が走ってしまうようなので、全部切りたいときにも使える…