From c9fc4fbbe205ff69fa20ded822b2214847b59726 Mon Sep 17 00:00:00 2001 From: chai <215380520@qq.com> Date: Mon, 18 Mar 2024 10:03:48 +0800 Subject: *misc --- _ActiveRagdoll/Gravity.cs | 47 ----------------------------------------------- 1 file changed, 47 deletions(-) delete mode 100644 _ActiveRagdoll/Gravity.cs (limited to '_ActiveRagdoll/Gravity.cs') 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(); - allRigs = GetComponent(); - standingData = GetComponent(); - holding = GetComponent(); - } - - 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); - } - } - } -} -- cgit v1.1-26-g67d0