Files
FallBots/Assets/Content/Scripts/PlayerEvent.cs
2026-03-19 21:34:27 +01:00

25 lines
532 B
C#

using UnityEngine;
using UnityEngine.Events;
public class PlayerEvent : MonoBehaviour
{
public UnityEvent OnPlayerEnter;
public UnityEvent OnPlayerExit;
void OnTriggerEnter(Collider col)
{
if (Player.Instance && col.gameObject == Player.Instance.gameObject)
{
OnPlayerEnter?.Invoke();
}
}
void OnTriggerExit(Collider col)
{
if (Player.Instance && col.gameObject == Player.Instance.gameObject)
{
OnPlayerExit?.Invoke();
}
}
}