Browse Source

Added hold to yeet

develop
Joshua Reason 3 years ago
parent
commit
96c96c9c27
1 changed files with 5 additions and 4 deletions
  1. +5
    -4
      Assets/Scripts/Behaviours/YeetController.cs

+ 5
- 4
Assets/Scripts/Behaviours/YeetController.cs View File

@ -157,7 +157,6 @@ public class YeetController : InputBehaviour
private void OnTriggerEnter(Collider collider) private void OnTriggerEnter(Collider collider)
{ {
Debug.Log("PlayerInputController.OnTriggerEnter: arrived");
m_child = collider.gameObject; m_child = collider.gameObject;
} }
@ -169,6 +168,8 @@ public class YeetController : InputBehaviour
private void OnYeet(InputAction.CallbackContext args) private void OnYeet(InputAction.CallbackContext args)
{ {
Debug.Log($"Player Yeeting: {args.phase}");
parent = m_body; parent = m_body;
switch (yeetState) switch (yeetState)
{ {
@ -182,7 +183,7 @@ public class YeetController : InputBehaviour
Yeet(); Yeet();
break; break;
case YeetController.YeetState.Held: case YeetController.YeetState.Held:
/*if (args.phase == InputActionPhase.Started)*/
if (args.phase == InputActionPhase.Started)
Preyeet(); Preyeet();
// Yeet baby // Yeet baby
@ -195,13 +196,13 @@ public class YeetController : InputBehaviour
public override void RegisterInput(PlayerInput playerInput) public override void RegisterInput(PlayerInput playerInput)
{ {
playerInput.currentActionMap.FindAction("Yeet").performed += OnYeet;
playerInput.currentActionMap.FindAction("Yeet").canceled += OnYeet;
playerInput.currentActionMap.FindAction("Yeet").started += OnYeet; playerInput.currentActionMap.FindAction("Yeet").started += OnYeet;
} }
public override void UnregisterInput(PlayerInput playerInput) public override void UnregisterInput(PlayerInput playerInput)
{ {
playerInput.currentActionMap.FindAction("Yeet").performed -= OnYeet;
playerInput.currentActionMap.FindAction("Yeet").canceled -= OnYeet;
playerInput.currentActionMap.FindAction("Yeet").started -= OnYeet; playerInput.currentActionMap.FindAction("Yeet").started -= OnYeet;
} }
} }

Loading…
Cancel
Save