public void UpdateIKTargets(IKSnapshotType type, bool isLeft) { IKSnapshot snap = GetIKSnapshot(type); Vector3 targetBodyPos = snap.bodyPos; if (isLeft) { targetBodyPos.x = -targetBodyPos.x; } bodyHelper.localPosition = targetBodyPos; if (snap.overrideHeadPosition) { headHelper.localPosition = snap.headPos; } else { headHelper.localPosition = defaultHeadPos; } handHelper.localPosition = snap.handPos; handHelper.localEulerAngles = snap.handEulers; }
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); Vector3 targetBodyPos = snap.bodyPos; if (isLeft) { targetBodyPos.x = -targetBodyPos.x; } bodyHelper.localPosition = targetBodyPos; handHelper.localPosition = snap.handPos; handHelper.localEulerAngles = snap.hand_eulers; /* * if (snap.overwriteHeadPos) * headHelper.localPosition = snap.headPos; * else * headHelper.localPosition = defaultHeadPos; */ }