Created
March 16, 2024 08:56
-
-
Save paralleltree/9babd236bc2a22ab613250f0b0b967af 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