Created
March 16, 2024 09:01
-
-
Save LosXLucifer/77b45fd7a69a5d9c3d4099a64d2201c9 to your computer and use it in GitHub Desktop.
Compression
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
just for the sake of commenting