void Awake() { if (gameObject.name.Contains("Left")) { if (left == null) { left = this; leftHandPoseManager = gameObject.GetComponentInChildren <UnityHandPoseManager>(); } else if (left != this) { Destroy(this); } return; } if (gameObject.name.Contains("Right")) { if (right == null) { right = this; rightHandPoseManager = gameObject.GetComponentInChildren <UnityHandPoseManager>(); } else if (right != this) { Destroy(this); } return; } }
private float getCurrentPosition(int assignedID, int fingerID) { UnityHandPoseManager hand = assignedID == 0 ? rightPoseManager : leftPoseManager; IFingerRotationNormalized[] fingers = hand.CurHandRotationNormalized.Fingers; return(fingers[fingerID].Bend.Value); }