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/StayInPlace.cs | 50 ------------------------------------------- 1 file changed, 50 deletions(-) delete mode 100644 _ActiveRagdoll/StayInPlace.cs (limited to '_ActiveRagdoll/StayInPlace.cs') diff --git a/_ActiveRagdoll/StayInPlace.cs b/_ActiveRagdoll/StayInPlace.cs deleted file mode 100644 index d10ebba..0000000 --- a/_ActiveRagdoll/StayInPlace.cs +++ /dev/null @@ -1,50 +0,0 @@ -using UnityEngine; - -public class StayInPlace : MonoBehaviour -{ - private InputHandler input; - - public Rigidbody rig; - - public float force; - - private Vector3 stopPosition; - - private bool isBroken; - - private PlayerDeath death; - - private Strength str; - - private float strength = 1f; - - private void Start() - { - str = GetComponent(); - input = GetComponent(); - death = GetComponent(); - stopPosition = rig.position; - } - - private void FixedUpdate() - { - if (death.dead) - { - return; - } - strength = str.strength; - if (input.inputMovementDirection.magnitude > 0.1f) - { - stopPosition = rig.position + rig.velocity * 0.25f; - isBroken = false; - } - else if (!isBroken) - { - if (Vector3.Distance(stopPosition, rig.position) > 1f) - { - isBroken = true; - } - rig.AddForce((stopPosition - rig.position) * force * strength, ForceMode.Acceleration); - } - } -} -- cgit v1.1-26-g67d0