diff options
author | chai <215380520@qq.com> | 2024-03-18 10:03:48 +0800 |
---|---|---|
committer | chai <215380520@qq.com> | 2024-03-18 10:03:48 +0800 |
commit | c9fc4fbbe205ff69fa20ded822b2214847b59726 (patch) | |
tree | c9bcce93d3a887b0070aeeee5c1db80b7b112043 /_ActiveRagdoll/Gravity.cs | |
parent | 793c4eae324d394f19a8bac66a803bf03a67ae9d (diff) |
Diffstat (limited to '_ActiveRagdoll/Gravity.cs')
-rw-r--r-- | _ActiveRagdoll/Gravity.cs | 47 |
1 files changed, 0 insertions, 47 deletions
diff --git a/_ActiveRagdoll/Gravity.cs b/_ActiveRagdoll/Gravity.cs deleted file mode 100644 index f646f0c..0000000 --- a/_ActiveRagdoll/Gravity.cs +++ /dev/null @@ -1,47 +0,0 @@ -using UnityEngine; - -public class Gravity : MonoBehaviour -{ - public float baseGravity; - - public float scalingGravity; - - private RigidbodyHolder allRigs; - - private StandingDataHandler standingData; - - private Holding holding; - - private PlayerDeath death; - - private void Start() - { - death = GetComponent<PlayerDeath>(); - allRigs = GetComponent<RigidbodyHolder>(); - standingData = GetComponent<StandingDataHandler>(); - holding = GetComponent<Holding>(); - } - - private void FixedUpdate() - { - if (death.dead) - { - return; - } - for (int i = 0; i < allRigs.GetAllRigs().Length; i++) - { - allRigs.GetAllRigs()[i].AddForce(Vector3.down * baseGravity + Vector3.down * scalingGravity * standingData.sinceGrounded, ForceMode.Acceleration); - } - if ((bool)holding) - { - if ((bool)holding.heldObject) - { - holding.heldObject.rig.AddForce(Vector3.down * baseGravity + Vector3.down * scalingGravity * standingData.sinceGrounded, ForceMode.Acceleration); - } - if ((bool)holding.heldObjectOffHand) - { - holding.heldObjectOffHand.rig.AddForce(Vector3.down * baseGravity + Vector3.down * scalingGravity * standingData.sinceGrounded, ForceMode.Acceleration); - } - } - } -} |