下载此文档

Unity3d教你如何批量修改贴图导入设置工具脚本.doc


文档分类: | 页数:约4页 举报非法文档有奖
1/4
下载提示
  • 1.该资料是网友上传的,本站提供全文预览,预览什么样,下载就什么样。
  • 2.下载该文档所得收入归上传者、原创者。
  • 3.下载的文档,不会出现我们的网址水印。
1/4 下载此文档
文档列表 文档介绍
这个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 {
 
[MenuItem ("Custom/Texture/Change Texture Format/Auto")]
static void ChangeTextureFormat_Auto() {
SelectedChangeTextureFormatSet

Unity3d教你如何批量修改贴图导入设置工具脚本 来自淘豆网m.daumloan.com转载请标明出处.

非法内容举报中心
文档信息
  • 页数4
  • 收藏数0 收藏
  • 顶次数0
  • 上传人mh900965
  • 文件大小28 KB
  • 时间2018-03-21