public void UpdateIKTargets(IKSnaphotType type, bool isLeft) { Debug.Log("UpdateIKTarget for: " + type); IKSnapShot snapShot = GetSnapShot(type); Vector3 targetBodyPos = snapShot.bodyPos; if (isLeft) { targetBodyPos.x = -targetBodyPos.x; } bodyHelper.localPosition = targetBodyPos; handHelper.localPosition = snapShot.handPos; handHelper.localEulerAngles = snapShot.handEulers; if (snapShot.overrideHeadPos) { headHelper.localPosition = snapShot.headPos; } else { headHelper.localPosition = defaultHeadPos; } }
IKSnapShot GetSnapShot(IKSnaphotType type) { for (int i = 0; i < ikSnapshots.Length; i++) { if (ikSnapshots[i].type == type) { return(ikSnapshots[i]); } } return(null); }