2021-02-14 16:08:59 +01:00
|
|
|
using System.Collections;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using UnityEngine;
|
2021-02-19 21:38:45 +01:00
|
|
|
using Ktyl.Util;
|
2021-02-14 16:08:59 +01:00
|
|
|
|
|
|
|
public class ArtefactTriggerArea : MonoBehaviour
|
|
|
|
{
|
2021-02-19 21:38:45 +01:00
|
|
|
[SerializeField] private SerialInt _nearbyArtefactID;
|
2021-02-22 10:01:33 +01:00
|
|
|
[SerializeField] private ArtefactControl _artefact;
|
2021-02-19 21:38:45 +01:00
|
|
|
|
2021-02-22 10:01:33 +01:00
|
|
|
private int id => _artefact.artefactID;
|
|
|
|
|
2021-02-14 16:08:59 +01:00
|
|
|
private void OnTriggerEnter(Collider Player)
|
|
|
|
{
|
2021-02-22 10:01:33 +01:00
|
|
|
EventHandler.current.ArtefactTriggerEnter(id);
|
2021-02-19 21:38:45 +01:00
|
|
|
//PlayerInputHandler.id = _id;
|
2021-02-22 10:01:33 +01:00
|
|
|
_nearbyArtefactID.Value = id;
|
2021-02-14 16:08:59 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
private void OnTriggerExit(Collider Player)
|
|
|
|
{
|
2021-02-22 10:01:33 +01:00
|
|
|
EventHandler.current.ArtefactTriggerExit(id);
|
2021-02-19 21:38:45 +01:00
|
|
|
//PlayerInputHandler.id = 0;
|
|
|
|
_nearbyArtefactID.Value = -1;
|
2021-02-14 16:08:59 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|