|
|
|
|
|
|
using System.Collections; |
|
|
|
using System.Collections.Generic; |
|
|
|
using UnityEngine; |
|
|
|
using UnityEngine.InputSystem; |
|
|
|
using UnityEngine; |
|
|
|
|
|
|
|
//Enum of the possible Interaction types, we can add later if needed
|
|
|
|
//None is the default value as its value is '0'
|
|
|
|
|
|
|
private Interaction _interactionType; |
|
|
|
//To store the object we are currently interacting with
|
|
|
|
GameObject currentInteractableObject; |
|
|
|
//Or do we want to have stg specefic for every type of interaction like:
|
|
|
|
//Item for pickup?
|
|
|
|
//Character (or other relevant type) for talk?
|
|
|
|
|
|
|
|
|
|
|
|
//Events for the different interaction types
|
|
|
|
[Header("Broadcasting on")] |
|
|
|
|
|
|
case Interaction.None: |
|
|
|
return; |
|
|
|
case Interaction.PickUp: |
|
|
|
//Maybe better add check if gb not null here?
|
|
|
|
_OnObjectPickUp.RaiseEvent(currentInteractableObject); |
|
|
|
Debug.Log("PickUp event raised"); |
|
|
|
break; |
|
|
|
|
|
|
|
|
|
|
private void OnTriggerEnter(Collider other) |
|
|
|
{ |
|
|
|
if (other.CompareTag("Pickable ")) |
|
|
|
if (other.CompareTag("Pickable")) |
|
|
|
Debug.Log("I triggered a pickable object!"); |
|
|
|
//Raise event to display UI or have a ref de display it from here
|
|
|
|
//Raise event to display UI or have a ref de display it from here
|
|
|
|
Debug.Log("I triggered a cooking pot!"); |
|
|
|
//Raise event to display UI or have a ref de display it from here
|
|
|
|
Debug.Log("I triggered an NPC!"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|