Skip to content

Instantly share code, notes, and snippets.

@LosXLucifer
Created March 16, 2024 09:01
Show Gist options
  • Save LosXLucifer/77b45fd7a69a5d9c3d4099a64d2201c9 to your computer and use it in GitHub Desktop.
Save LosXLucifer/77b45fd7a69a5d9c3d4099a64d2201c9 to your computer and use it in GitHub Desktop.
Compression
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}");
}
}
}
@LosXLucifer
Copy link
Author

just for the sake of commenting

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment