using UnityEngine;
using System.Collections;
using UnityEditor;
/// <summary>
/// 在从外部导入texture、或者在导入之后对texture的自动处理
/// </summary>
public class ImportResDemo : AssetPostprocessor {
/// <summary>
/// 在导入纹理之后调用
/// </summary>
/// <param name="texture"></param>
public void OnPostprocessTexture(Texture2D texture)
{
TextureImporter textureImporter = AssetImporter.GetAtPath(assetPath) as TextureImporter;
if (textureImporter != null)
{
string AtlasName = new System.IO.DirectoryInfo(System.IO.Path.GetDirectoryName(assetPath)).Name;
Debug.Log("name is: " + AtlasName);
Debug.Log("textureType is: " + textureImporter.textureType);
Debug.Log("maxTextureSize is: " + textureImporter.maxTextureSize);
Debug.Log("textureFormat is: " + textureImporter.tex
Unity之AssetPostprocessor学习一
最新推荐文章于 2024-03-25 16:26:26 发布