Created
March 16, 2024 09:01
-
-
Save LosXLucifer/40a0769c2f863ce3125167c0fed38901 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
using UnityEditor; | |
namespace Paltee.Extensions | |
{ | |
public class ForceCrunchCompressionOff : AssetPostprocessor | |
{ | |
void OnPreprocessTexture() | |
{ | |
var importer = assetImporter as TextureImporter; | |
if (importer == null) return; | |
// prevent processing for existing assets | |
if (!importer.importSettingsMissing) { return; } | |
if (!importer.crunchedCompression) return; | |
importer.crunchedCompression = false; | |
context.LogImportWarning($"Forced off crunch compression for {assetPath}"); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment