unity3D 根据所在文件夹自动设置一些属性

来源:互联网 发布:实况埃芬博格数据 编辑:程序博客网 时间:2024/06/05 09:25




12
13
14
15
16
17
18
usingUnityEngine;
usingSystem.Collections;
usingUnityEditor;
usingSystem.IO;
 
publicclass  Post:AssetPostprocessor
{
 
voidOnPostprocessTexture(Texture2Dtexture)
{
stringAtlasName=  newDirectoryInfo(Path.GetDirectoryName(assetPath)).Name;
TextureImportertextureImporter  =assetImporterasTextureImporter;
textureImporter.textureType=TextureImporterType.Sprite;
textureImporter.spritePackingTag=AtlasName;
textureImporter.mipmapEnabled=false;
}
 
}
12
13
14
15
16
17
18
usingUnityEngine;
usingSystem.Collections;
usingUnityEditor;
usingSystem.IO;
 
publicclass  Post:AssetPostprocessor
{
 
voidOnPostprocessTexture(Texture2Dtexture)
{
stringAtlasName=  newDirectoryInfo(Path.GetDirectoryName(assetPath)).Name;
TextureImportertextureImporter  =assetImporterasTextureImporter;
textureImporter.textureType=TextureImporterType.Sprite;
textureImporter.spritePackingTag=AtlasName;
textureImporter.mipmapEnabled=false;
}
 
}
0 0
原创粉丝点击