using UnityEngine;
using UnityEditor;
using System.Collections;
using System.IO;
using System.Collections.Generic;

public class SetTools
{

[MenuItem("Custom/SetMaterrial")]
public static void SetMaterrial()
{
foreach (GameObject volumeGo in Selection.gameObjects)
{
string volumeName = volumeGo.name;
foreach (Transform t in volumeGo.transform)
{
t.gameObject.SetActive(false);
string timeName = t.name;
char[] c = timeName.ToCharArray();
foreach (Transform t2 in t)
{
t2.gameObject.AddComponent<MeshCollider>();
string path = "Assets/water/" + volumeName + "/Animation000" + c[1] + ".jpg";
Texture texture = AssetDatabase.LoadAssetAtPath(path, typeof(Texture)) as Texture;
t2.GetComponent<MeshRenderer>().sharedMaterial.mainTexture = texture;
}
}
}

unity自定义工具的更多相关文章

  1. (Unity)Unity自定义Debug日志文件,利用VS生成Dll文件并使用Dotfuscated进展混淆,避免被反编译

    Unity自定义Debug日志文件,利用VS生成Dll文件并使用Dotfuscated进行混淆,避免被反编译. 1.打开VS,博主所用版本是Visual Studio 2013. 2.新建一个VC项目 ...

  2. 错误 4 自定义工具错误: 无法生成服务引用“DepartMentService”的代码。请检查其他错

    原文:错误 4 自定义工具错误: 无法生成服务引用"DepartMentService"的代码.请检查其他错 问题:     错误 4 自定义工具错误: 无法生成服务引用" ...

  3. 修改node来增加自定义工具命令

    如何通过node创建自定义cmd命令 一.命令功能的实现 1.将自己的自定义工具的文件夹放到当前使用的 node 的安装目录下的 node_modules 文件夹下面: 2.回到node安装目录下复制 ...

  4. [转载]一个高效简洁的Aseprite to Unity导入工具

    原文链接 https://zhuanlan.zhihu.com/p/28644268  期待原作者上传至AssetStore. 今天,我的第一个 Unity 插件 MetaSprite 正式发布了它的 ...

  5. HTM L百度地图API 自定义工具地图实例

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...

  6. 为VS定制一个自己的代码生成器 - 自定义工具开发

    自定义工具开发 为VS定制一个自己的代码生成器 如何在Visual Studio中开发自己的代码生成器插件 你必须懂的 T4 模板:深入浅出 Regasm组件注册工具使用方法 Regasm 注册C# ...

  7. Thinkphp自定义工具类的使用!

    在使用Thinkphp做开发的时候,很多时候会用到一些自己写的类,为了方便管理,可以把这些类,单独放到一个文件里. 这就是自定义工具类: 首先在 Application 目录下新建 Component ...

  8. ArcGIS 将自定义工具发布到ArcGIS Server,作为Geoprocessing Service

    新建自定义工具过程可参考上一篇博客:http://www.cnblogs.com/oceanking/p/3933681.html 1.执行自定义工具.此步骤不可省略 打开ArcCatalog,双击自 ...

  9. ThinkPHP3验证码、文件上传、缩略图、分页(自定义工具类、session和cookie)

    验证码 TP框架中自带了验证码类 位置:Think/verify.class.php 在LoginController控制器中创建生存验证码的方法 login.html登陆模板中 在LoginCont ...

随机推荐

  1. 《Android深度探索HAL与驱动开发》第一章阅读心得

    首先了解到Android系统架构是由四层构成:其中第一层是Linux内核,他的作用是负责Linux的驱动程序以及内存.进程.电源等管理操作:第二层是C/C++代码库,也就是Linux下.so的文件:第 ...

  2. Android驱动开发前的准备(三)

    Git使用入门 3.1安装Git 3.2查看Git文档 3.3源代码的提交与获取 3.1安装Git # apt-get install git # apt-get install git-doc gi ...

  3. git的使用,通过git上传修改工程

    一:下载git,https://git-scm.com/downloads(若下载速度慢,可下载百度下的)接下来,默认配置,一直next 二:在github上注册账号,并新建一个项目test(英文有点 ...

  4. HTML5画布实现方法:

    我们可以在HTML中使用属性width和height来定义Canvas.但是实现Canvas的相关功能主要还依赖于Javascript实现,即HTML5 Canvas API.我们使用javascri ...

  5. windosw应用提示内存不足

    找到如下注册表分支: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\ CurrentVersion\Windows 在右侧窗口中可以看到名为&quo ...

  6. redis 3.2.6 on ubuntu 14.04

    1. official site: https://github.com/antirez/redis/releases 2. compile and setup tar zxf redis-3.2.6 ...

  7. TTS通过JavaScript调用

    <script type="text/ecmascript"> var VoiceObj = new ActiveXObject("Sapi.SpVoice& ...

  8. js实现光标位置置后

    //定位div(contenteditable = "true"),上传图片后,光标移到输入框后面 function po_Last_Div(obj) { if (window.g ...

  9. Add Digits, Maximum Depth of BinaryTree, Search for a Range, Single Number,Find the Difference

    最近做的题记录下. 258. Add Digits Given a non-negative integer num, repeatedly add all its digits until the ...

  10. Laravel项目目录结构说明

    Laravel项目目录结构说明: |- vendor 目录包含你的 Composer 依赖模块及laravel框架. |- bootstrap 目录包含几个框架启动跟自动加载配置的文件. |- app ...