Skip to content

Instantly share code, notes, and snippets.

@yumehachi
Created November 23, 2013 13:37
Show Gist options
  • Save yumehachi/7614669 to your computer and use it in GitHub Desktop.
Save yumehachi/7614669 to your computer and use it in GitHub Desktop.
2Dゲーム制作時に毎回Mipmapを消すのが面倒なのでsettingフォルダに入っているファイルのmipmapをテクスチャインポート時に外す
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