继承自AssetPstprocessor并编写对应逻辑
using UnityEngine;using UnityEditor;// Automatically convert any texture file with "_bumpmap"// in its file name into a normal map.class MyTexturePostprocessor : AssetPostprocessor{ void OnPreprocessTexture() { if (assetPath.Contains("_bumpmap")) { TextureImporter textureImporter = (TextureImporter)assetImporter; textureImporter.convertToNormalmap = true; } }}参考
https://docs.unity3d.com/ScriptReference/AssetPostprocessor.htmlhttps://docs.unity3d.com/ScriptReference/AssetPostprocessor.html