public void Calc(string stateName) { if (Object.op_Equality((Object)this.frameCorrect, (Object)null)) { return; } this.InitFrameCalc(); MotionIKData.State nowState = this.GetNowState(stateName); if (nowState != null) { int ikTargetLength = MotionIK.IKTargetPair.IKTargetLength; foreach (MotionIKData.Frame frame in nowState.frames) { int index = frame.frameNo - ikTargetLength; if (index >= 0) { BaseCorrect.Info info = this.frameCorrect.list[index]; info.enabled = true; Vector3[] correctShapeValues = this.GetCorrectShapeValues(this.partners[frame.editNo].info, frame.shapes); info.pos = correctShapeValues[0]; info.ang = correctShapeValues[1]; } } } this.enabled = nowState != null; for (int index1 = 0; index1 < this.ikTargetPairs.Length; ++index1) { int index2 = index1; this.LinkIK(index2, nowState, this.ikTargetPairs[index2]); } }
public void Calc(int hashName) { if (Object.op_Equality((Object)this.frameCorrect, (Object)null)) { return; } this.InitFrameCalc(); MotionIKData.State nowState = this.GetNowState(hashName); if (nowState != null) { int ikTargetLength = MotionIK.IKTargetPair.IKTargetLength; foreach (MotionIKData.Frame frame in nowState.frames) { int index = frame.frameNo - ikTargetLength; if (index >= 0) { BaseCorrect.Info info = this.frameCorrect.list[index]; info.enabled = true; Vector3[] correctShapeValues = this.GetCorrectShapeValues(this.partners[frame.editNo].info, frame.shapes); info.pos = correctShapeValues[0]; info.ang = correctShapeValues[1]; } } } this.enabled = this.MapIK || nowState != null; if (!this.MapIK) { for (int index1 = 0; index1 < this.ikTargetPairs.Length; ++index1) { int index2 = index1; this.LinkIK(index2, nowState, this.ikTargetPairs[index2]); } } else if (nowState != null) { for (int index1 = 0; index1 < this.ikTargetPairs.Length; ++index1) { int index2 = index1; this.LinkIK(index2, nowState, this.ikTargetPairs[index2]); } } else { for (int index1 = 0; index1 < this.ikTargetPairs.Length; ++index1) { int index2 = index1; this.tmpData = (BaseData)((Component)this.ikTargetPairs[index2].effector.target).GetComponent <BaseData>(); if (Object.op_Equality((Object)this.tmpData.bone, (Object)null)) { this.tmpData.bone = this.DefBone[index2 * 2]; ((Behaviour)((Component)this.tmpData).GetComponent <BaseProcess>()).set_enabled(true); this.ikTargetPairs[index2].effector.positionWeight = (__Null)1.0; this.ikTargetPairs[index2].effector.rotationWeight = (__Null)1.0; } this.tmpData = (BaseData)((Component)this.ikTargetPairs[index2].bend.bendGoal).GetComponent <BaseData>(); if (Object.op_Equality((Object)this.tmpData.bone, (Object)null)) { ((Behaviour)((Component)this.tmpData).GetComponent <BaseProcess>()).set_enabled(true); this.tmpData.bone = this.DefBone[index2 * 2 + 1]; this.ikTargetPairs[index2].bend.weight = (__Null)1.0; } } } }