unity3d 选择一个物体递归输出所有节点名字
2016-03-24 17:14
399 查看
using UnityEngine; using UnityEditor; using System.Collections; public class PrintNode : Editor{ [MenuItem("PrintNode/Print")] public static void Print() { GameObject obj = Selection.activeGameObject; string str = ""; Check(obj.transform, "", ref str); Debug.LogWarning(str); } static void Check(Transform tf, string gap, ref string str) { str += gap + tf.name + "\n"; foreach (Transform item in tf) { Check(item, gap + " ", ref str); } } }
放在Editor下
相关文章推荐
- Unity3d热更新(四):压缩文件
- [Unity游戏开发]向量在游戏开发中的应用(二)
- Unity 2d 开发实战
- unity3D AR涂涂乐制作浅谈
- unity2d之2d帧动画创建
- unity2d之2d帧动画创建
- unity工具IGamesTools之批量生成帧动画
- [Unity3D]Unity3D游戏开发之自己主动寻路与Mecanim动画系统的结合
- Unity3D 与android交互流程步骤
- 我在自学unity所遇到的坑,持续更新
- Unity3D 一键更换场景物体
- unity5.2.3MonoDevelop编辑不了,报错xx is not under control
- Unity5自动命名Assetbundle并打包
- Unity新项目如何快速理清顶层代码结构
- Unity3D 物体跟随鼠标旋转
- unity MD5加密
- Unity中的场景切换
- unity获取物体下的所有子物体
- Unity3D手游开发中所有特殊的文件夹
- 【Unity3D技巧】在Unity中使用事件/委托机制(event/delegate)进行GameObject之间的通信 (二) : 引入中间层NotificationCenter