summaryrefslogtreecommitdiff
path: root/StepHandler.cs
diff options
context:
space:
mode:
Diffstat (limited to 'StepHandler.cs')
-rw-r--r--StepHandler.cs53
1 files changed, 0 insertions, 53 deletions
diff --git a/StepHandler.cs b/StepHandler.cs
deleted file mode 100644
index fd8110b..0000000
--- a/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<LegLeft>().transform;
- rightLeg = GetComponentInChildren<LegRight>().transform;
- animationHandler = GetComponent<AnimationHandler>();
- hip = GetComponentInChildren<Hip>().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;
- }
-}