给场景自动添加AssetBundleName
来源:互联网 发布:实用五金工具手册软件 编辑:程序博客网 时间:2024/05/16 17:20
[MenuItem("Tools/Auto Scene Bundle")]static void AutoSceneBundleName(){List<string> filesPaths = new List<string>(); filesPaths.AddRange( Directory.GetFiles(Path.GetFullPath(".") + Path.DirectorySeparatorChar, "*.unity", SearchOption.AllDirectories) ); int counter = -1; foreach (string filePath in filesPaths) { EditorUtility.DisplayProgressBar("Auto Scene Bundle", filePath, counter / (float) filesPaths.Count); counter++; var path = filePath.Substring (filePath.IndexOf("Assets"));AssetImporter importer = AssetImporter.GetAtPath (path);if(importer!=null){importer.assetBundleName = filePath.Substring(filePath.LastIndexOf("/")+1);importer.SaveAndReimport ();}} EditorUtility.ClearProgressBar(); AssetDatabase.Refresh(); }
会遍历所有的场景,给场景添加AssetBundleName,名字为场景的名
阅读全文
0 0
- 给场景自动添加AssetBundleName
- 给开始场景添加背景音乐和给按键添加声音
- 在OpenGL中给场景添加光照
- 给vi自动添加注释
- 自动给文本添加行号
- 给flash添加按钮,实现各个场景间切换
- 如何给DataGrid添加自动增长列
- 如何给DataGrid添加自动增长列
- 如何给DataGrid添加自动增长列
- 如何给DataGrid添加自动增长列
- 给DataGrid添加index序号,自动编号
- [原创]给DataGrid快速添加自动编号
- 如何给DataGrid添加自动增长列
- 如何给DataGrid添加自动增长列
- [原创]给DataGrid快速添加自动编号
- 如何给DataGrid添加自动增长列
- WinForm中给DataGridView添加 自动编号
- dataGridView1自动给行添加序号
- CART算法实例解析
- 第十六天总结
- HDOJ 1330 Deck
- Oracle监听 报错TNS-12541: TNS: 无监听程序 TNS-12560: TNS: 协议适配器错误 TNS-00511: 无监听程序
- 71. Simplify Path
- 给场景自动添加AssetBundleName
- Java中关于内存泄露出现的原因和避免措施
- 一、adb-wifi连接注意问题
- 分布式ID方案有哪些以及各自的优劣势,我们当如何选择
- C#连接MySql
- 字符串转换整型
- ZOJ 3985 String Of CCPC 字符串,模拟
- Android点击两次返回键退出应用
- qt中的拖拽及其使用技巧