CharacterTriggerable.cs (640B)
1 using System; 2 using Slimecing.SOEventSystem.Events; 3 using UnityEngine; 4 5 namespace Slimecing.Characters 6 { 7 public class CharacterTriggerable : MonoBehaviour 8 { 9 [Header("Events")] 10 [SerializeField] private TriggerEvent onSlimeTriggerEnter; 11 private void OnTriggerEnter(Collider other) 12 { 13 switch (other.gameObject.tag) 14 { 15 case "Slime": 16 onSlimeTriggerEnter.Raise(other); 17 break; 18 } 19 } 20 21 /*private void OnTriggerExit(Collider other) 22 { 23 onTriggerExit.Raise(other); 24 }*/ 25 } 26 }