// Get the index of a multiplayer of type private int GetMultiplierIndex(WeightCurve.Type weightCurveType) { for (int i = 0; i < multipliers.Length; i++) { if (multipliers[i].result == weightCurveType) return i; } return -1; }
public float GetValue(WeightCurve weightCurve, float timer) { return(weightCurve.GetValue(timer) * multiplier); }
// Get the index of a weight curve of type private int GetWeightCurveIndex(WeightCurve.Type weightCurveType) { for (int i = 0; i < weightCurves.Length; i++) { if (weightCurves[i].type == weightCurveType) return i; } return -1; }
// Apply the curve to the specified solver, effector, with the value and weight. private void Apply(IKSolverFullBodyBiped solver, FullBodyBipedEffector effector, WeightCurve.Type type, float value, float weight) { switch(type) { case WeightCurve.Type.PositionWeight: solver.GetEffector(effector).positionWeight = Mathf.Lerp(solver.GetEffector(effector).positionWeight, value, weight); return; case WeightCurve.Type.RotationWeight: solver.GetEffector(effector).rotationWeight = Mathf.Lerp(solver.GetEffector(effector).rotationWeight, value, weight); return; case WeightCurve.Type.PositionOffsetX: solver.GetEffector(effector).position += (positionOffsetSpace != null? positionOffsetSpace.rotation: solver.GetRoot().rotation) * Vector3.right * value * weight; return; case WeightCurve.Type.PositionOffsetY: solver.GetEffector(effector).position += (positionOffsetSpace != null? positionOffsetSpace.rotation: solver.GetRoot().rotation) * Vector3.up * value * weight; return; case WeightCurve.Type.PositionOffsetZ: solver.GetEffector(effector).position += (positionOffsetSpace != null? positionOffsetSpace.rotation: solver.GetRoot().rotation) * Vector3.forward * value * weight; return; case WeightCurve.Type.Pull: solver.GetChain(effector).pull = Mathf.Lerp(solver.GetChain(effector).pull, value, weight); return; case WeightCurve.Type.Reach: solver.GetChain(effector).reach = Mathf.Lerp(solver.GetChain(effector).reach, value, weight); return; case WeightCurve.Type.Push: solver.GetChain(effector).push = Mathf.Lerp(solver.GetChain(effector).push, value, weight); return; case WeightCurve.Type.PushParent: solver.GetChain(effector).pushParent = Mathf.Lerp(solver.GetChain(effector).pushParent, value, weight); return; } }
// Gets the value of a weight curve/multiplier public float GetValue(WeightCurve.Type weightCurveType, InteractionTarget target, float timer) { int index = GetWeightCurveIndex(weightCurveType); if (index != -1) { float mlp = target == null? 1f: target.GetValue(weightCurveType); return weightCurves[index].GetValue(timer) * mlp; } for (int i = 0; i < multipliers.Length; i++) { if (multipliers[i].result == weightCurveType) { int wIndex = GetWeightCurveIndex(multipliers[i].curve); if (wIndex != -1) { float mlp = target == null? 1f: target.GetValue(multipliers[i].result); return multipliers[i].GetValue(weightCurves[wIndex], timer) * mlp; } } } return 0f; }
// Get the multiplied value of the curve at the specified time public float GetValue(WeightCurve weightCurve, float timer) { return weightCurve.GetValue(timer) * multiplier; }
} // 0x00000001804C2F30-0x00000001804C2F40 // Methods public float GetValue(WeightCurve weightCurve, float timer) => default; // 0x00000001807E6EB0-0x00000001807E6EF0