Skip to content

Instantly share code, notes, and snippets.

@pointcache
Created October 4, 2016 20:49
Show Gist options
  • Save pointcache/5f3eac7d4a2392fc7132b4eba089ec35 to your computer and use it in GitHub Desktop.
Save pointcache/5f3eac7d4a2392fc7132b4eba089ec35 to your computer and use it in GitHub Desktop.
using UnityEngine;
using UnityEditor;
class TextureImportOverrides : AssetPostprocessor
{
void OnPreprocessTexture()
{
TextureImporter textureImporter = (TextureImporter)assetImporter;
if (assetPath.Contains("_S"))
{
textureImporter.textureType = TextureImporterType.Sprite;
textureImporter.textureFormat = TextureImporterFormat.AutomaticTruecolor;
}
if (assetPath.Contains("_PF"))
{
textureImporter.filterMode = FilterMode.Point;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment