Files
FallBotsB3/Assets/_Content/Scripts/PlayerEvent.cs

16 lines
323 B
C#

using UnityEngine;
using UnityEngine.Events;
public class PlayerEvent : MonoBehaviour
{
[SerializeField] private UnityEvent _onPlayer;
void OnTriggerEnter(Collider col)
{
if (Player.Instance && Player.Instance.gameObject == col.gameObject)
{
_onPlayer?.Invoke();
}
}
}