18 lines
388 B
C#
18 lines
388 B
C#
using UnityEngine;
|
|
using UnityEngine.Events;
|
|
|
|
public class TackleDetection : MonoBehaviour
|
|
{
|
|
[SerializeField] private TackleKind tackleKind;
|
|
public UnityEvent<TackleKind, Collider> TackleResponse;
|
|
void OnTriggerEnter(Collider collider)
|
|
{
|
|
if (collider.tag != "Spike")
|
|
{
|
|
return;
|
|
}
|
|
TackleResponse.Invoke(tackleKind, collider);
|
|
}
|
|
}
|
|
|
|
public enum TackleKind { Critical, Normal } |