Created
November 23, 2013 13:37
-
-
Save yumehachi/7614669 to your computer and use it in GitHub Desktop.
2Dゲーム制作時に毎回Mipmapを消すのが面倒なのでsettingフォルダに入っているファイルのmipmapをテクスチャインポート時に外す
This file contains hidden or 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; | |
using System.Collections; | |
/// <summary> | |
/// インポート完了時にsettingフォルダに入れているTextureのMipmapをfalseにする | |
/// </summary> | |
/// <author> | |
/// Create by yumehachi on 2013/11/23 | |
/// </author> | |
class TextureSetting : AssetPostprocessor | |
{ | |
void OnPreprocessTexture () | |
{ | |
var lowerCaseAssetPath = assetPath.ToLower (); | |
if (lowerCaseAssetPath.IndexOf ("/setting/") == -1) { | |
return; | |
} | |
var importer = (assetImporter as TextureImporter); | |
importer.mipmapEnabled = false; | |
importer.textureType = TextureImporterType.Advanced; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment