diff options
author | chai <215380520@qq.com> | 2024-04-15 21:05:01 +0800 |
---|---|---|
committer | chai <215380520@qq.com> | 2024-04-15 21:05:01 +0800 |
commit | 0464810f2f83c86560c3422d664380d474cb3e56 (patch) | |
tree | 3548bec2d39f6e2a9803dd02dd2f636922ea07c7 /ActiveRagdoll/Assets/TABG/Scripts/Data/MovementDataHandler.cs | |
parent | f34c222b242c6fd01ed209ff827c614621160048 (diff) |
*misc
Diffstat (limited to 'ActiveRagdoll/Assets/TABG/Scripts/Data/MovementDataHandler.cs')
-rw-r--r-- | ActiveRagdoll/Assets/TABG/Scripts/Data/MovementDataHandler.cs | 47 |
1 files changed, 41 insertions, 6 deletions
diff --git a/ActiveRagdoll/Assets/TABG/Scripts/Data/MovementDataHandler.cs b/ActiveRagdoll/Assets/TABG/Scripts/Data/MovementDataHandler.cs index 9a87817..073ecbd 100644 --- a/ActiveRagdoll/Assets/TABG/Scripts/Data/MovementDataHandler.cs +++ b/ActiveRagdoll/Assets/TABG/Scripts/Data/MovementDataHandler.cs @@ -1,3 +1,6 @@ +using Rigging.BodyPart; +using Rigging.Debugging; +using System; using System.Collections; using System.Collections.Generic; using UnityEngine; @@ -6,16 +9,48 @@ namespace Rigging.Data { public class MovementDataHandler : RiggingDataBase { - // Start is called before the first frame update - void Start() + + [HideInInspector, NonSerialized] + public Vector3 groundedForward; + + [HideInInspector, NonSerialized] + public Vector3 right; + + [HideInInspector, NonSerialized] + public Vector3 left; + + [HideInInspector, NonSerialized] + public Vector3 groundedBack; + + [HideInInspector, NonSerialized] + public float sinceJump = 1f; + + [HideInInspector, NonSerialized] + public float slopeStrenght; + + public Transform rotationTarget; + + private Rigging.BodyPart.Hip hip; + + protected override void OnStart() { - + base.OnStart(); + + hip = player.body.hip; } - // Update is called once per frame - void Update() + private void Update() { - + sinceJump += Time.deltaTime; + groundedForward = rotationTarget.forward; + groundedForward.y = slopeStrenght * 1f; + groundedForward = groundedForward.normalized; + groundedBack = -groundedForward; + right = rotationTarget.right; + left = -rotationTarget.right; + slopeStrenght = Mathf.Lerp(slopeStrenght, 0f, Time.deltaTime * 1f); + + GLHandle.DrawLine(hip.transform.position, hip.transform.position + groundedForward * 10f); } } |