From 96c96c9c275f8f27fec7ae6e74a69233287b36b8 Mon Sep 17 00:00:00 2001 From: Joshua Reason Date: Sun, 31 Jan 2021 17:38:53 +1100 Subject: [PATCH] Added hold to yeet --- Assets/Scripts/Behaviours/YeetController.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Assets/Scripts/Behaviours/YeetController.cs b/Assets/Scripts/Behaviours/YeetController.cs index 9cc92b4..b042413 100644 --- a/Assets/Scripts/Behaviours/YeetController.cs +++ b/Assets/Scripts/Behaviours/YeetController.cs @@ -157,7 +157,6 @@ public class YeetController : InputBehaviour private void OnTriggerEnter(Collider collider) { - Debug.Log("PlayerInputController.OnTriggerEnter: arrived"); m_child = collider.gameObject; } @@ -169,6 +168,8 @@ public class YeetController : InputBehaviour private void OnYeet(InputAction.CallbackContext args) { + Debug.Log($"Player Yeeting: {args.phase}"); + parent = m_body; switch (yeetState) { @@ -182,7 +183,7 @@ public class YeetController : InputBehaviour Yeet(); break; case YeetController.YeetState.Held: - /*if (args.phase == InputActionPhase.Started)*/ + if (args.phase == InputActionPhase.Started) Preyeet(); // Yeet baby @@ -195,13 +196,13 @@ public class YeetController : InputBehaviour public override void RegisterInput(PlayerInput playerInput) { - playerInput.currentActionMap.FindAction("Yeet").performed += OnYeet; + playerInput.currentActionMap.FindAction("Yeet").canceled += OnYeet; playerInput.currentActionMap.FindAction("Yeet").started += OnYeet; } public override void UnregisterInput(PlayerInput playerInput) { - playerInput.currentActionMap.FindAction("Yeet").performed -= OnYeet; + playerInput.currentActionMap.FindAction("Yeet").canceled -= OnYeet; playerInput.currentActionMap.FindAction("Yeet").started -= OnYeet; } } \ No newline at end of file