• unity自定义工具


    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;
    }
    }
    }

  • 相关阅读:
    go
    go
    go
    postgresql
    go
    go
    sql
    铂金软件公司
    HRIS 的价值评估
    [转]数据库SQL优化大总结之 百万级数据库优化方案
  • 原文地址:https://www.cnblogs.com/943711466qq/p/6246598.html
Copyright © 2020-2023  润新知