summaryrefslogtreecommitdiff
path: root/ActiveRagdoll/Assets/TABG/Scripts/Data/StepHandler.cs
diff options
context:
space:
mode:
Diffstat (limited to 'ActiveRagdoll/Assets/TABG/Scripts/Data/StepHandler.cs')
-rw-r--r--ActiveRagdoll/Assets/TABG/Scripts/Data/StepHandler.cs27
1 files changed, 16 insertions, 11 deletions
diff --git a/ActiveRagdoll/Assets/TABG/Scripts/Data/StepHandler.cs b/ActiveRagdoll/Assets/TABG/Scripts/Data/StepHandler.cs
index 3caa488..4e6ebed 100644
--- a/ActiveRagdoll/Assets/TABG/Scripts/Data/StepHandler.cs
+++ b/ActiveRagdoll/Assets/TABG/Scripts/Data/StepHandler.cs
@@ -1,4 +1,5 @@
using Rigging.BodyPart;
+using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
@@ -15,15 +16,13 @@ namespace Rigging.Data
public bool isLeft;//左脚还是右脚在前面
- private float counter;
+ public float counter;
- private Transform leftLeg;
+ public Transform leftLeg;
- private Transform rightLeg;
+ public Transform rightLeg;
- private AnimationHandler animationHandler;
-
- private Transform hip;
+ public Transform hip;
protected override void OnStart()
{
@@ -31,7 +30,6 @@ namespace Rigging.Data
{
leftLeg = player.body.legLeft.transform;
rightLeg = player.body.legRight.transform;
- animationHandler = player.status.animation;
hip = player.body.hip.transform;
}
steps.SetPlayer(player);
@@ -47,9 +45,11 @@ namespace Rigging.Data
Switch();
}
}
- else if (counter > steps.current.minTime
- && (steps.current.minAngle == 0f || steps.current.minAngle < Vector3.Angle(leftLeg.forward, rightLeg.forward))
- && isLeft == hip.InverseTransformPoint(leftLeg.position + leftLeg.forward).z > hip.InverseTransformPoint(rightLeg.position + rightLeg.forward).z)
+ else if ( counter > steps.current.minTime
+ //&& (steps.current.minAngle == 0f || steps.current.minAngle < Vector3.Angle(leftLeg.forward, rightLeg.forward))
+ //&& (steps.current.minAngle == 0f || steps.current.minAngle < Vector3.Angle(leftLeg.forward, rightLeg.forward))
+ //&& isLeft == hip.InverseTransformPoint(leftLeg.position + leftLeg.forward).z > hip.InverseTransformPoint(rightLeg.position + rightLeg.forward).z
+ )
{
Switch();
}
@@ -61,6 +61,11 @@ namespace Rigging.Data
counter = 0f;
}
+ public void OnGUI()
+ {
+ GUILayout.Label(isLeft.ToString());
+ }
+
}
-} \ No newline at end of file
+} \ No newline at end of file