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 /FootHandler.cs | |
parent | 6ce8b9e22fc13be34b442c7b6af48b42cd44275a (diff) |
* move
Diffstat (limited to 'FootHandler.cs')
-rw-r--r-- | FootHandler.cs | 75 |
1 files changed, 0 insertions, 75 deletions
diff --git a/FootHandler.cs b/FootHandler.cs deleted file mode 100644 index 7343e21..0000000 --- a/FootHandler.cs +++ /dev/null @@ -1,75 +0,0 @@ -using UnityEngine; - -public class FootHandler : MonoBehaviour -{ - private AnimationHandler animHandler; - - private Collider collider; - - public PhysicMaterial slippery; - - private PhysicMaterial footMaterial; - - private Transform torso; - - private MovementDataHandler moveData; - - private Rigidbody rig; - - private RotationHandler rot; - - private Vector3 rotationDif; - - private AnimationObject anim; - - private StepHandler handler; - - private void Start() - { - animHandler = base.transform.root.GetComponent<AnimationHandler>(); - moveData = base.transform.root.GetComponent<MovementDataHandler>(); - collider = GetComponentInChildren<Collider>(); - rig = GetComponent<Rigidbody>(); - footMaterial = collider.material; - torso = base.transform.root.GetComponentInChildren<Torso>().transform; - rot = base.transform.root.GetComponent<RotationHandler>(); - handler = base.transform.root.GetComponent<StepHandler>(); - anim = GetComponentInChildren<AnimationObject>(); - } - - private void Update() - { - float num = Mathf.Abs(torso.position.x - base.transform.position.x) + Mathf.Abs(torso.position.z - base.transform.position.z); - if (rot.hipCorrectionAmount > 30f || ((bool)anim && anim.isLeft != handler.isLeft)) - { - SetFoot(active: false); - } - else if (animHandler.animationState == 0) - { - if (num > 0.1f || rotationDif.magnitude > 15f) - { - SetFoot(active: false); - } - else - { - SetFoot(active: true); - } - } - else - { - SetFoot(active: true); - } - } - - private void FixedUpdate() - { - } - - private void SetFoot(bool active) - { - if (active) - { - collider.material = footMaterial; - } - } -} |