CharacterCollideable.cs (706B)
1 using System; 2 using Slimecing.SOEventSystem.Events; 3 using UnityEngine; 4 5 namespace Slimecing.Characters 6 { 7 public class CharacterCollideable : MonoBehaviour 8 { 9 [Header("Events")] 10 [SerializeField] private CollisionEvent onSlimeColliderEnter; 11 private void OnCollisionEnter(Collision other) 12 { 13 //Debug.Log(other.gameObject.tag); 14 switch (other.gameObject.tag) 15 { 16 case "Slime": 17 onSlimeColliderEnter.Raise(other); 18 break; 19 } 20 } 21 22 /*private void OnCollisionExit(Collision other) 23 { 24 throw new NotImplementedException(); 25 }*/ 26 } 27 }