[MenuItem("PrintNode/Print")]
public static void Print()
{
GameObject fbx = Selection.activeGameObject;
string nodeName = "";
Check(fbx.transform, "", ref nodeName);
Debug.LogWarning(nodeName);
Debug.Log(dictionary.Count);
}
static void Check(Transform fpx, string gap, ref string nodeName)
{
nodeName += gap + fpx.name + "\n";
dictionary.Add(dictionary.Count, fpx.name);
foreach (Transform item in fpx)
{
Check(item, gap + " ", ref nodeName);
}
}
unity 用递归方法找出模型的所有子节点
最新推荐文章于 2023-06-25 16:55:54 发布