Checkpoint

This commit is contained in:
2026-03-19 21:34:27 +01:00
parent 5b8fecd593
commit 532ede9714
9 changed files with 531 additions and 19 deletions

View File

@@ -0,0 +1,24 @@
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();
}
}
}