using System; using UnityEngine; namespace Leap.Unity { public class SkeletalFinger : FingerModel { public override void InitFinger() { this.SetPositions(); } public override void UpdateFinger() { Debug.Log("SkeletalFinger.SetPositions()"); this.SetPositions(); } protected void SetPositions() { for (int i = 0; i < this.bones.Length; i++) { if (this.bones[i] != null) { this.bones[i].transform.position = base.GetBoneCenter(i); this.bones[i].transform.rotation = base.GetBoneRotation(i); } } for (int j = 0; j < this.joints.Length; j++) { if (this.joints[j] != null) { this.joints[j].transform.position = base.GetJointPosition(j + 1); this.joints[j].transform.rotation = base.GetBoneRotation(j + 1); } } } } }