using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.Events; public class ShellBoom : MonoBehaviour { public UnityEvent onShellAttack = new UnityEvent(); public bool isPlayer = false; private void OnTriggerEnter(Collider other) { Debug.Log(other.gameObject.name); if (isPlayer && other.tag == "AttackTarget") { onShellAttack?.Invoke(); } } }