NewN_UAVPlane/Assets/Zion/Scripts/Adam/Components/ShellBoom.cs

19 lines
454 B
C#

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();
}
}
}