IKSnapShot GetSnapShot(IKSnapShotType type) { for (int i = 0; i < ikSnapShots.Length; i++) { if (ikSnapShots[i].type == type) { return(ikSnapShots[i]); } } return(null); }
public void UpdateIKTargets(IKSnapShotType type, bool isLeft) { IKSnapShot snap = GetSnapShot(type); handHelper.localPosition = snap.handPos; handHelper.localEulerAngles = snap.hand_eulers; bodyHelper.localPosition = snap.bodyPos; if (snap.overwriteHeadPos) { headHelper.localPosition = snap.headPos; } else { headHelper.localPosition = defaultHeadPos; } }