diff options
author | chai <215380520@qq.com> | 2024-04-16 23:31:39 +0800 |
---|---|---|
committer | chai <215380520@qq.com> | 2024-04-16 23:31:39 +0800 |
commit | 7af1acc694a14570a86b9dc432f3766e0ff9bbe2 (patch) | |
tree | befb97aae010b9e03dfd0d91e2d015f30f8b1724 /ActiveRagdoll/Assets/TABG/Scripts | |
parent | 150e1e98d1c6866e0d1fa2abf042f71cc766ed8e (diff) |
*misc
Diffstat (limited to 'ActiveRagdoll/Assets/TABG/Scripts')
3 files changed, 53 insertions, 0 deletions
diff --git a/ActiveRagdoll/Assets/TABG/Scripts/Debug/DebugCollider.cs b/ActiveRagdoll/Assets/TABG/Scripts/Debug/DebugCollider.cs new file mode 100644 index 0000000..a887c48 --- /dev/null +++ b/ActiveRagdoll/Assets/TABG/Scripts/Debug/DebugCollider.cs @@ -0,0 +1,34 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace Rigging.Debugging +{ + + [ExecuteInEditMode] + public class DebugCollider : MonoBehaviour + { + public MeshRenderer[] renderers; + + public bool draw; + + void FetchRenderers() + { + if (renderers == null || renderers.Length == 0) + { + renderers = GetComponentsInChildren<MeshRenderer>(); + } + } + + void Update() + { + FetchRenderers(); + + for (int i = 0; i < renderers.Length; ++i) + { + renderers[i].enabled = draw; + } + } + } + +}
\ No newline at end of file diff --git a/ActiveRagdoll/Assets/TABG/Scripts/Debug/DebugCollider.cs.meta b/ActiveRagdoll/Assets/TABG/Scripts/Debug/DebugCollider.cs.meta new file mode 100644 index 0000000..cb33cfe --- /dev/null +++ b/ActiveRagdoll/Assets/TABG/Scripts/Debug/DebugCollider.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ffdcfebb31e298f45909264bd508a0ea +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/ActiveRagdoll/Assets/TABG/Scripts/Input/InputHandler.cs b/ActiveRagdoll/Assets/TABG/Scripts/Input/InputHandler.cs index f5e5ea2..da174de 100644 --- a/ActiveRagdoll/Assets/TABG/Scripts/Input/InputHandler.cs +++ b/ActiveRagdoll/Assets/TABG/Scripts/Input/InputHandler.cs @@ -1,3 +1,4 @@ +using Rigging.Action; using Rigging.Cameras; using Rigging.Data; using System; @@ -19,11 +20,14 @@ namespace Rigging.Inputs private MovementDataHandler movementData; + private Movement movement; + public bool isSpringting = false; private void Start() { movementData = GetComponentInChildren<MovementDataHandler>(); + movement = GetComponentInChildren<Movement>(); } private void Update() @@ -53,6 +57,10 @@ namespace Rigging.Inputs { lastInputDirection = inputMovementDirection; } + if ((bool)movement && Input.GetKeyDown(KeyCode.Space)) + { + movement.Jump(); + } } } |