22 lines
508 B
C#
22 lines
508 B
C#
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEditor.AdaptivePerformance.Editor;
|
|
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 } |