Implement enemies getting to a finish, enemy dying
This commit is contained in:
20
Assets/Scripts/Components/DetectTriggerComponent.cs
Normal file
20
Assets/Scripts/Components/DetectTriggerComponent.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using Sirenix.OdinInspector;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Events;
|
||||
|
||||
public class DetectTriggerComponent : MonoBehaviour
|
||||
{
|
||||
public UnityEvent<Collider> onTriggerEnter;
|
||||
public UnityEvent<Collider> onTriggerExit;
|
||||
|
||||
private void OnTriggerEnter(Collider other)
|
||||
{
|
||||
onTriggerEnter?.Invoke(other);
|
||||
}
|
||||
private void OnTriggerExit(Collider other)
|
||||
{
|
||||
onTriggerExit?.Invoke(other);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user