public override Global.MuscleGroupStateProps GetStateProp(StateController.ActionState action) { Global.MuscleGroupStateProps pb1 = NormalBodyStateProps.ContainsKey(action.bodyAction) ? NormalBodyStateProps[action.bodyAction] : null; Global.MuscleGroupStateProps pb2 = NormalHandStateProps.ContainsKey(action.handAction) ? NormalHandStateProps[action.handAction] : null; return(pb1 + pb2); }
public void UpdateStateProps() { Global.MuscleGroupStateProps mgs = am.actorParts.GetStateProp(actionState); foreach (var groupProp in baseProps) { PropsBase pb = mgs.GetGroupProp(groupProp.MscleGroup); if (pb != null) { groupProp.stateProp.SetValue(pb); } } // StopAllCoroutines(); // StartCoroutine(PropSetCoroutine(1f, mgs)); }
// 携程方式 逐渐过渡式地改变 肌肉属性 // TODO 测试 是否可去 private IEnumerator PropSetCoroutine(float time, Global.MuscleGroupStateProps mgs) { float curF = 0; PropsBase pbtemp = new PropsBase(0, 0, 0, 0, 0); while (curF < 1.0) { foreach (var groupProp in baseProps) { PropsBase pb = mgs.GetGroupProp(groupProp.MscleGroup); if (pb != null) { pbtemp.Accuracy = Mathf.Lerp(groupProp.stateProp.Accuracy, pb.Accuracy, curF); pbtemp.Agility = Mathf.Lerp(groupProp.stateProp.Agility, pb.Agility, curF); pbtemp.Power = Mathf.Lerp(groupProp.stateProp.Power, pb.Power, curF); pbtemp.Toughness = Mathf.Lerp(groupProp.stateProp.Accuracy, pb.Toughness, curF); groupProp.stateProp.SetValue(pbtemp); } } curF += Time.deltaTime; yield return(new WaitForEndOfFrame()); } foreach (var groupProp in baseProps) { PropsBase pb = mgs.GetGroupProp(groupProp.MscleGroup); if (pb != null) { pbtemp.Accuracy = Mathf.Lerp(groupProp.stateProp.Accuracy, pb.Accuracy, 1.0f); pbtemp.Agility = Mathf.Lerp(groupProp.stateProp.Agility, pb.Agility, 1.0f); pbtemp.Power = Mathf.Lerp(groupProp.stateProp.Power, pb.Power, 1.0f); pbtemp.Toughness = Mathf.Lerp(groupProp.stateProp.Accuracy, pb.Toughness, 1.0f); groupProp.stateProp.SetValue(pbtemp); } } }
// new Global.MuscleGroupStateProps( // new Dictionary<short, StateController.PropsBase> // { // [HumanoidParts.MucleGroupIndex.HEAD] = new StateController.PropsBase(1.0f, 1.0f, 1.0f, 1.0f), // [HumanoidParts.MucleGroupIndex.BODY] = new StateController.PropsBase(1.0f, 1.0f, 1.0f, 1.0f), // [HumanoidParts.MucleGroupIndex.RHAND] = new StateController.PropsBase(1.0f, 1.0f, 1.0f, 1.0f), // [HumanoidParts.MucleGroupIndex.LHAND] = new StateController.PropsBase(1.0f, 1.0f, 1.0f, 1.0f), // [HumanoidParts.MucleGroupIndex.LFOOT] = new StateController.PropsBase(1.0f, 1.0f, 1.0f, 1.0f), // [HumanoidParts.MucleGroupIndex.RFOOT] = new StateController.PropsBase(1.0f, 1.0f, 1.0f, 1.0f), // } // ), public Skill(string name, short zoneType, Dictionary <short, StateController.PropsBase> SkillProp) { skillName = name; propCorrection = new Global.MuscleGroupStateProps(SkillProp); this.zoneType = zoneType; }