From 793c4eae324d394f19a8bac66a803bf03a67ae9d Mon Sep 17 00:00:00 2001 From: chai <215380520@qq.com> Date: Sat, 16 Mar 2024 12:39:34 +0800 Subject: *misc --- _ActiveRagdoll/StepHandler.cs | 53 ------------------------------------------- 1 file changed, 53 deletions(-) delete mode 100644 _ActiveRagdoll/StepHandler.cs (limited to '_ActiveRagdoll/StepHandler.cs') diff --git a/_ActiveRagdoll/StepHandler.cs b/_ActiveRagdoll/StepHandler.cs deleted file mode 100644 index fd8110b..0000000 --- a/_ActiveRagdoll/StepHandler.cs +++ /dev/null @@ -1,53 +0,0 @@ -using UnityEngine; - -public class StepHandler : MonoBehaviour -{ - public float staticCounter; - - public Step[] steps; - - public bool isLeft; - - private float counter; - - private Transform leftLeg; - - private Transform rightLeg; - - private AnimationHandler animationHandler; - - private Transform hip; - - private void Start() - { - if (staticCounter == 0f) - { - leftLeg = GetComponentInChildren().transform; - rightLeg = GetComponentInChildren().transform; - animationHandler = GetComponent(); - hip = GetComponentInChildren().transform; - } - } - - private void Update() - { - counter += Time.deltaTime; - if (staticCounter != 0f) - { - if (counter > staticCounter) - { - Switch(); - } - } - else if (counter > steps[animationHandler.animationState].minTime && (steps[animationHandler.animationState].minAngle == 0f || steps[animationHandler.animationState].minAngle < Vector3.Angle(leftLeg.forward, rightLeg.forward)) && isLeft == hip.InverseTransformPoint(leftLeg.position + leftLeg.forward).z > hip.InverseTransformPoint(rightLeg.position + rightLeg.forward).z) - { - Switch(); - } - } - - private void Switch() - { - isLeft = !isLeft; - counter = 0f; - } -} -- cgit v1.1-26-g67d0