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();
|
||||
}
|
||||
}
|
||||
}
|
||||
2
Assets/_Content/Scripts/PlayerEvent.cs.meta
Normal file
2
Assets/_Content/Scripts/PlayerEvent.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ca25aee54150dd34894b1e9a83523c4e
|
||||
Reference in New Issue
Block a user