diff options
author | chai <215380520@qq.com> | 2024-03-13 11:38:18 +0800 |
---|---|---|
committer | chai <215380520@qq.com> | 2024-03-13 11:38:18 +0800 |
commit | 134f1deb971b0514a26e04e23926f91983a5497f (patch) | |
tree | d790681bb000c07abae9f557a7d0ef2442fac467 /Standing.cs | |
parent | 6ce8b9e22fc13be34b442c7b6af48b42cd44275a (diff) |
* move
Diffstat (limited to 'Standing.cs')
-rw-r--r-- | Standing.cs | 55 |
1 files changed, 0 insertions, 55 deletions
diff --git a/Standing.cs b/Standing.cs deleted file mode 100644 index 6162215..0000000 --- a/Standing.cs +++ /dev/null @@ -1,55 +0,0 @@ -using UnityEngine; - -public class Standing : MonoBehaviour -{ - public RigidbodyMovment[] rigsToLift; - - public AnimationCurve[] animationLiftCurves; - - private StandingDataHandler standingData; - - private AnimationHandler animationHandler; - - public float offset; - - private PlayerDeath death; - - private Strength str; - - private float muscleMultiplier = 1f; - - private float legAngleMultiplier; - - private MovementDataHandler moveData; - - private void Start() - { - death = GetComponent<PlayerDeath>(); - str = GetComponent<Strength>(); - standingData = GetComponent<StandingDataHandler>(); - moveData = GetComponent<MovementDataHandler>(); - animationHandler = GetComponent<AnimationHandler>(); - } - - private void FixedUpdate() - { - if (!death.dead) - { - muscleMultiplier = str.strength; - if (standingData.isGrounded) - { - Stand(animationLiftCurves[animationHandler.animationState]); - } - } - } - - private void Stand(AnimationCurve curve) - { - legAngleMultiplier = 1f; - RigidbodyMovment[] array = rigsToLift; - foreach (RigidbodyMovment rigidbodyMovment in array) - { - rigidbodyMovment.rig.AddForce(Vector3.up * muscleMultiplier * rigidbodyMovment.force * legAngleMultiplier * curve.Evaluate(standingData.distanceToGround + offset + moveData.slopeVelocityStrenght * -0.2f), ForceMode.Acceleration); - } - } -} |