unity3d小插件之查找结点路径并自动写入到剪贴板
2016-07-13 13:47
453 查看
using UnityEngine; using UnityEditor; using System.Collections; using System.Collections.Generic; using System.IO; public class FindPath { public static List<string> filelist = new List<string>(); public static List<string> deallist = new List<string>(); public static string filepath; // Use this for initialization [MenuItem("My Game/FindPath")] public static void GetPath() { clearmemory(); recursiveFind(Selection.activeGameObject.gameObject); printinScreen(); clearmemory(); } public static void recursiveFind(GameObject go) { if (go != null) { filelist.Add(go.name); if (go.transform.parent != null) { recursiveFind(go.transform.parent.gameObject); } } } public static void clearmemory() { filelist.Clear(); deallist.Clear(); } public static void printinScreen() { for(int i = filelist.Count -1 ; i >= 0 ; i --) { string str = filelist[i]; if(i != 0) { str = str +"/"; } deallist.Add(str); } string showstr = ""; foreach(var list in deallist) { showstr += list; } Debug.Log(showstr); TextEditor te = new TextEditor(); te.content = new GUIContent(showstr); te.SelectAll(); te.Copy(); } }
相关文章推荐
- 数学基础知识之Sin、cos画圆
- unity 多重纹理 绘制 shader处理
- Unity5.0 EventSystem事件系统的详细说明
- 记一次基于Unity的Profiler性能分析
- 【Unity3D自学记录】鼠标拖拽物体移动
- 【Unity3D自学记录】制作VR视频播放器
- 【Unity3D自学记录】Unity5 之 standard参数
- Unity3d如何制作声音开关按钮
- KEngine:Unity3D资源的打包、加载、调试监控
- unity 3d
- 我的第一个工程-一个台球游戏3-介绍篇一:场景模型的搭建
- unity3d 第二天
- Unity触摸控制旋转缩放
- 【Unity Shaders】学习笔记——SurfaceShader(十一)光照模型
- 【Unity技巧】四元数(Quaternion)和旋转
- Unity位置动画
- Unity模型与动画思维导图1.0
- Unity Taiwan: Unity 4.3 關於 Occlusion Culling : 最佳做法
- Unity3D性能优化--- 收集整理的一堆
- Unity 性能优化 Draw Call