Inpût Àctións
This commit is contained in:
@ -5,6 +5,7 @@ using System.Linq;
|
||||
using Interaction;
|
||||
using JetBrains.Annotations;
|
||||
using UnityEngine;
|
||||
using UnityEngine.InputSystem;
|
||||
using UnityEngine.Serialization;
|
||||
using Utility;
|
||||
|
||||
@ -40,22 +41,28 @@ public class InteractionHandler : MonoBehaviour
|
||||
}
|
||||
}
|
||||
|
||||
void Update()
|
||||
public void DoSelectPreviousAction(InputAction.CallbackContext context)
|
||||
{
|
||||
if (Input.GetKeyDown(KeyCode.LeftArrow))
|
||||
{
|
||||
SelectPreviousAction();
|
||||
}
|
||||
if (!context.performed)
|
||||
return;
|
||||
|
||||
if (Input.GetKeyDown(KeyCode.RightArrow))
|
||||
{
|
||||
SelectNextAction();
|
||||
}
|
||||
|
||||
if (Input.GetKeyDown(KeyCode.E))
|
||||
{
|
||||
DoInteraction();
|
||||
}
|
||||
SelectPreviousAction();
|
||||
}
|
||||
|
||||
public void DoSelectNextAction(InputAction.CallbackContext context)
|
||||
{
|
||||
if (!context.performed)
|
||||
return;
|
||||
|
||||
SelectNextAction();
|
||||
}
|
||||
|
||||
public void DoInteract(InputAction.CallbackContext context)
|
||||
{
|
||||
if (!context.performed)
|
||||
return;
|
||||
|
||||
DoInteraction();
|
||||
}
|
||||
|
||||
private void DoInteraction()
|
||||
|
||||
Reference in New Issue
Block a user