添加插件
This commit is contained in:
16
Assets/Obvious/Soap/Examples/Content/Scripts/Enemy.cs
Normal file
16
Assets/Obvious/Soap/Examples/Content/Scripts/Enemy.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.Events;
|
||||
|
||||
namespace Obvious.Soap.Example
|
||||
{
|
||||
public class Enemy : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private UnityEvent _onHitPlayerEvent = null;
|
||||
|
||||
private void OnTriggerEnter(Collider other)
|
||||
{
|
||||
if (other.CompareTag("Player"))
|
||||
_onHitPlayerEvent?.Invoke();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user