Inpût Àctións

This commit is contained in:
Simon Lübeß
2024-04-07 00:58:57 +02:00
parent 3bdf7231e3
commit 029ca69924
9 changed files with 490 additions and 34 deletions

View File

@ -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()