Created
April 19, 2015 09:52
-
-
Save umiyuki/e8ef0c3501c288a58823 to your computer and use it in GitHub Desktop.
Unity3DでProjectビューで選択したフォルダ以下の2DテクスチャのGenerateMipmapsを全部外すエディタ拡張
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; | |
public class ChangeTextureImportSettings : MonoBehaviour { | |
[MenuItem("Custom/Texture/CheckOffGenerateMipmaps")] | |
static void CheckOffGenerateMipmaps() | |
{ | |
Object[] textures = Selection.GetFiltered(typeof(Texture2D), SelectionMode.DeepAssets | SelectionMode.Assets); | |
foreach (Texture2D texture in textures) | |
{ | |
string path = AssetDatabase.GetAssetPath(texture); | |
TextureImporter texImporter = AssetImporter.GetAtPath(path) as TextureImporter; | |
if (texImporter.mipmapEnabled) | |
{ | |
texImporter.mipmapEnabled = false; | |
AssetDatabase.ImportAsset(path); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment