/// <summary>
 /// Returns only the bones with the specified JointObject.
 /// </summary>
 public static Transform[] GetBonesOfType(JointObject type, Transform[] bones)
 {
     return bones.Where(b => (b != null && GetType(b.name) == type)).ToArray();
 }
 /// <summary>
 /// Returns only the joints with the specified Side.
 /// </summary>
 /// <param name="jointSide">The side of the joint</param>
 /// <param name="joints">The Transforms where to search</param>
 /// <returns>A list of matching Transforms</returns>
 public static Transform[] GetJointsOfSide(BodySide jointSide, Transform[] joints)
 {
     return joints.Where(j => (j != null && GetSideOfJointName(j.name) == jointSide)).ToArray();
 }
Example #3
0
        private Transform FindRigTransformByName(string rigName, Transform[] transforms)
        {
            var targetTransform = transforms.Where((t) => t.name == rigName).FirstOrDefault();

            if (targetTransform != null)
            {
                var pos = targetTransform.localPosition;
                var rot = targetTransform.localRotation;
                Util.Log("Bone rig " + rigName + " found! Pos: " + pos.x + ", " + pos.y + ", " + pos.z + "  Rot: " + rot.x + ", " + rot.y + ", " + rot.z + ", " + rot.w);
            }
            else
            {
                Util.Log("Bone rig " + rigName + " not found...");
            }
            return targetTransform;
        }