Files
Fishing2/Assets/Obvious/Soap/Examples/Content/Scripts/Enemy.cs
2026-01-01 23:09:08 +08:00

16 lines
374 B
C#

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();
}
}
}