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




12
13
14
15
16
17
18
using UnityEngine ;
using System . Collections ;
using UnityEditor ;
using System . IO ;
 
public class    Post : AssetPostprocessor
{
 
void OnPostprocessTexture ( Texture2D texture )
{
string AtlasName =    new DirectoryInfo ( Path . GetDirectoryName ( assetPath ) ) . Name ;
TextureImporter textureImporter    = assetImporter as TextureImporter ;
textureImporter . textureType = TextureImporterType . Sprite ;
textureImporter . spritePackingTag = AtlasName ;
textureImporter . mipmapEnabled = false ;
}
 
}
12
13
14
15
16
17
18
using UnityEngine ;
using System . Collections ;
using UnityEditor ;
using System . IO ;
 
public class    Post : AssetPostprocessor
{
 
void OnPostprocessTexture ( Texture2D texture )
{
string AtlasName =    new DirectoryInfo ( Path . GetDirectoryName ( assetPath ) ) . Name ;
TextureImporter textureImporter    = assetImporter as TextureImporter ;
textureImporter . textureType = TextureImporterType . Sprite ;
textureImporter . spritePackingTag = AtlasName ;
textureImporter . mipmapEnabled = false ;
}
 
}

你可能感兴趣的:(unity3D 根据所在文件夹自动设置一些属性)