AR Foundation演示项目,使用 AR Foundation 4.1.7 并围绕某些功能演示更高级功能。
您最多选择25个主题 主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 

43 行
999 B

using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class JointHandler : MonoBehaviour
{
[SerializeField]
[Tooltip("Root joint at root of rig skeleton, should be named Root_1")]
Transform m_SkeletonRoot;
public Transform skeletonRoot
{
get => m_SkeletonRoot;
set => m_SkeletonRoot = value;
}
public List<Transform> Joints { get; set; }
void OnEnable()
{
GetJoints();
}
public void GetJoints()
{
Joints = new List<Transform>();
Queue<Transform> nodes = new Queue<Transform>();
nodes.Enqueue(m_SkeletonRoot.parent);
while (nodes.Count > 0)
{
Transform next = nodes.Dequeue();
for (int i = 0; i < next.childCount; ++i)
{
nodes.Enqueue(next.GetChild(i));
}
Joints.Add(next);
}
}
}