void OnPostprocessTexture(Texture2D texture)
{
string dir = Path.GetDirectoryName(assetPath);
string dirName
= new DirectoryInfo
(dir
).Name; KNGUIUtils
.atlasType atlas
= (KNGUIUtils
.atlasType)System.Enum.Parse(typeof(KNGUIUtils
.atlasType), dirName
); if (dir.Contains(KNGUIUtils.SpritePath) && !KNGUIUtils.IsSpriteInAtlas(texture.name, atlas))
{
TextureImporter importer = assetImporter as TextureImporter;
importer.textureType = TextureImporterType.Advanced;
importer.isReadable = true;
importer.npotScale = TextureImporterNPOTScale.None;
importer.mipmapEnabled = false;
importer.textureFormat = TextureImporterFormat.AutomaticTruecolor;
importer.anisoLevel = 0;
UIAtlasMaker.AddOrUpdate(KNGUIUtils.GetAtlas(atlas), texture);
}
}