50 lines
1015 B
C#
50 lines
1015 B
C#
using Ktyl.Util;
|
|
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class EventHandler : MonoBehaviour
|
|
{
|
|
//[SerializeField] private SerialInt nearbyArtefactID;
|
|
public static EventHandler current;
|
|
|
|
private void Awake()
|
|
{
|
|
current = this;
|
|
}
|
|
|
|
public event Action<int> onArtefactTriggerEnter;
|
|
public void ArtefactTriggerEnter(int id)
|
|
{
|
|
if (onArtefactTriggerEnter != null)
|
|
{
|
|
onArtefactTriggerEnter(id);
|
|
}
|
|
|
|
}
|
|
|
|
public event Action<int> onArtefactTriggerExit;
|
|
public void ArtefactTriggerExit(int id)
|
|
{
|
|
if (onArtefactTriggerExit != null)
|
|
{
|
|
onArtefactTriggerExit(id);
|
|
}
|
|
|
|
}
|
|
|
|
public event Action<int> onArtefactPickUp;
|
|
public void ArtefactPickUp(int id)
|
|
{
|
|
if (onArtefactPickUp != null)
|
|
{
|
|
//if(nearbyArtefactID != -1)
|
|
// {
|
|
onArtefactPickUp(id);
|
|
//}
|
|
}
|
|
}
|
|
|
|
}
|