revival/game/Assets/Scripts/Artefacts/ArtefactTriggerArea.cs

27 lines
701 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Ktyl.Util;
public class ArtefactTriggerArea : MonoBehaviour
{
[SerializeField] private SerialInt _nearbyArtefactID;
[SerializeField] private ArtefactControl _artefact;
private int id => _artefact.artefactID;
private void OnTriggerEnter(Collider Player)
{
EventHandler.current.ArtefactTriggerEnter(id);
//PlayerInputHandler.id = _id;
_nearbyArtefactID.Value = id;
}
private void OnTriggerExit(Collider Player)
{
EventHandler.current.ArtefactTriggerExit(id);
//PlayerInputHandler.id = 0;
_nearbyArtefactID.Value = -1;
}
}