批量修改贴图导入设置工具脚本.docxVIP

  • 12
  • 0
  • 约1.73万字
  • 约 14页
  • 2020-06-11 发布于山东
  • 举报
批量修改贴图导入设置工具脚本 Posted on 2013年07月08日 by U3d / \o 查看 Unity3D脚本/插件 中的全部文章 Unity3D脚本/插件 /被围观 35 次 这个Unity3D批量修改贴图导入设置工具脚本十分小巧,但是威力大。特别针对大批量贴图要调整尺寸等等的时候作用尤为明显。在菜单中添加“Custom→Texture”的方式来批量改变所选的贴图导入设置。Unity本身只能一次打开一张图片进行导入设置,目前这个脚本可以批量更改贴图格式,是否开启MipMap,调整纹理最大尺寸,是否可读等等。 用法是把脚本放在你项目的资源目录的Editor文件夹下。然后选择你要批处理的纹理。到菜单中选择要处理的类型就可以了。 ChangeTextureImportSettings。csforUnity2.x 程序代码csharp代码: ?? ? 001 using UnityEngine; 002 using UnityEditor; 003 ? 004 // ///////////////////////////////////////////////////////////////////////////////////////////////////////// 005 // 006 // Batch Texture import settings modifier. 007 // 008 // Modifies all selected textures in the project window and applies the requested modification on the 009 // textures. Idea was to have the same choices for multiple files as you would have if you open the 010 // import settings of a single texture. Put this into Assets/Editor and once compiled by Unity you find 011 // the new functionality in Custom - Texture. Enjoy! :-) 012 // 013 // Based on the great work of benblo in this thread: 014 // /viewtopic.php?t=16079start=0postdays=0postorder=aschighlight=textureimporter 015 // 016 // Developed by Martin Schultz, Decane in August 2009 017 // e-mail: ms@ 018 // 019 // ///////////////////////////////////////////////////////////////////////////////////////////////////////// 020 public class ChangeTextureImportSettings : ScriptableObject { 021 ? 022 [MenuItem (Custom/Texture/Change Texture Format/Auto)] 023 static void ChangeTextureFormat_Auto() { 024 SelectedChangeTextureFormatSettings(TextureImporterFormat.Automatic); 025 } 026 ? 027 [MenuItem (Custom/Texture/Change Texture Format/RGB Compressed DXT1)] 028 static void ChangeTextureFormat_RGB_DXT1() { 029 SelectedChangeTextureFormatSettings(TextureImporterFormat.DXT1); 030 } 031 ? 032 [MenuItem (Custom/Texture/Change Texture Format/RGB Compressed DXT5)] 033 static void ChangeTextureFormat_RGB_DXT5() { 034 Selec

文档评论(0)

1亿VIP精品文档

相关文档