Created
February 16, 2012 05:00
-
-
Save darktable/1842177 to your computer and use it in GitHub Desktop.
Unity3D: Editor script to prevent images added to Assets/Platform from being compressed. (Requires Unity Pro?)
This file contains 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.IO; | |
using UnityEditor; | |
using UnityEngine; | |
public class IconPostprocessor : AssetPostprocessor { | |
void OnPreprocessTexture () { | |
if (assetPath.ToLower().StartsWith(Path.Combine("assets", "platform"))) { | |
var ti = (TextureImporter) assetImporter; | |
ti.filterMode = FilterMode.Point; | |
ti.mipmapEnabled = false; | |
ti.textureFormat = TextureImporterFormat.ARGB32; | |
ti.textureType = TextureImporterType.GUI; | |
ti.wrapMode = TextureWrapMode.Clamp; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment