wip: Player demo scene
This commit is contained in:
15
Assets/_Content/Scripts/PlayerEvent.cs
Normal file
15
Assets/_Content/Scripts/PlayerEvent.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user