Created
October 4, 2016 20:49
-
-
Save pointcache/5f3eac7d4a2392fc7132b4eba089ec35 to your computer and use it in GitHub Desktop.
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 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