批量更改图片属性 编辑器插件 TextureImportSetting.docxVIP

  • 14
  • 0
  • 约6.81千字
  • 约 8页
  • 2020-06-11 发布于山东
  • 举报

批量更改图片属性 编辑器插件 TextureImportSetting.docx

批量更改图片属性 编辑器插件 TextureImportSetting Posted on 2013年05月31日 by U3d / \o 查看 Unity3D脚本/插件 中的全部文章 Unity3D脚本/插件/被围观 104 次 使用说明: 在Assets文件夹下创建Editor文件夹,将复制或拷贝该代码保存成TextureImportSetting.cs放入Editor文件夹,将该脚本放入该文件夹选择需要批量设置的贴图,单击Costom/Texture Import Settings,打开窗口后选择对应参数,点击Set Texture ImportSettings,稍等片刻,批量设置成功。 001 using UnityEngine; 002 003 using System.Collections; 004 005 using UnityEditor; 006 007 /// 008 009 /// 010 011 /// 012 013 /// 014 015 /// 016 017 /// 018 019 /// 020 021 /// 022 023 public class TextureImportSetting : EditorWindow 024 025 { 026 027 /// 028 029 /// 临时存储int[] 030 031 /// 032 033 private int[] IntArray = new int[] { 0, 1, 2, 3, 4, 5, 6, 7 }; 034 035 //AnisoLevel 036 037 private int AnisoLevel = 1; 038 039 //Filter Mode 040 041 private int FilterModeInt = 0; 042 043 private string[] FilterModeString = new string[] { “Point”, “Bilinear”, “Trilinear” }; 044 045 //Wrap Mode 046 047 private int WrapModeInt = 0; 048 049 private string[] WrapModeString = new string[] { “Repeat”, “Clamp” }; 050 051 //Texture Type 052 053 private int TextureTypeInt = 0; 054 055 private string[] TextureTypeString = new string[] { “Texture”, “Normal Map”, “GUI”, “Refelection”, “Cookie”, “Lightmap”, “Advanced” }; 056 057 //Max Size 058 059 private int MaxSizeInt = 5; 060 061 private string[] MaxSizeString = new string[] { “32”, “64”, “128”, “256”, “512”, “1024”, “2048”, “4096” }; 062 063 //Format 064 065 private int FormatInt = 0; 066 067 private string[] FormatString = new string[] { “Compressed”, “16 bits”, “true color” }; 068 069 /// 070 071 /// 创建、显示窗体 072 073 /// 074 075 [@MenuItem(“Custom/Texture Import Settings”)] 076 077 private static void Init() 078 079 { 080 081 TextureImportSetting window = (TextureImportSetting)GetWindow(typeof(TextureImportSetting), true, “TextureImportSetting”); 082 083 window.Show(); 084 085 } 086 087 /// 088 089 /// 显示窗体里面的内容 090 091 /// 092 093 privat

文档评论(0)

1亿VIP精品文档

相关文档