浏览代码

Moved Interaction script to scripts folder

/main
Amel Negra 4 年前
当前提交
afc27181
共有 3 个文件被更改,包括 13 次插入5 次删除
  1. 18
      UOP1_Project/Assets/Scripts/InteractionManager.cs
  2. 0
      /UOP1_Project/Assets/Scripts/InteractionManager.cs
  3. 0
      /UOP1_Project/Assets/Scripts/InteractionManager.cs.meta

18
UOP1_Project/Assets/Scripts/InteractionManager.cs


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!");
}
}

/UOP1_Project/Assets/InteractionManager.cs → /UOP1_Project/Assets/Scripts/InteractionManager.cs

/UOP1_Project/Assets/InteractionManager.cs.meta → /UOP1_Project/Assets/Scripts/InteractionManager.cs.meta

正在加载...
取消
保存