这个Unity3D批量修改贴图导入设置工具脚本十分小巧,但是威力大。特别针对大批量贴图要调整尺寸等等的时候作用尤为明显。在菜单中添加“Custom→Texture”的方式来批量改变所选的贴图导入设置。Unity本身只能一次打开一张图片进行导入设置,目前这个脚本可以批量更改贴图格式,是否开启MipMap,调整纹理最大尺寸,是否可读等等。 用法是把脚本放在你项目的资源目录的Editor文件夹下。然后选择你要批处理的纹理。到菜单中选择要处理的类型就可以了。 ChangeTextureImportSettings。 程序代码csharp代码: using UnityEngine; using UnityEditor;
// ///////////////////////////////////////////////////////////////////////////////////////////////////////// // // Batch Texture import settings modifier. // // Modifies all selected textures in the project window and applies the requested modification on the // textures. Idea was to have the same choices for multiple files as you would have if you open the // import settings of a single texture. Put this into Assets/Editor and piled by Unity you find // the new functionality in Custom -> Texture. Enjoy! :-) // // Based on the great work of benblo in this thread: // http://forum./?t=16079&start=0&postdays=0&postorder=asc&highlight=textureimporter // // Developed by Martin Schultz, Decane in August 2009 // e-mail: ms@ // // ///////////////////////////////////////////////////////////////////////////////////////////////////////// public class ChangeTextureImportSettings : ScriptableObject {