Skip to content

Instantly share code, notes, and snippets.

@LosXLucifer
Created March 16, 2024 09:01
Show Gist options
  • Save LosXLucifer/40a0769c2f863ce3125167c0fed38901 to your computer and use it in GitHub Desktop.
Save LosXLucifer/40a0769c2f863ce3125167c0fed38901 to your computer and use it in GitHub Desktop.
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