using UnityEngine;
public class Gun
{
public delegate void Shoot();
public event Shoot ShootEvent;
}
public class GunManager : MonoBehaviour
{
public Gun SmallGun;
private void Start()
{
SmallGun.ShootEvent += First;
SmallGun.ShootEvent += Two;
if(SmallGun.ShootEvent() != null)
{
SmallGun.ShootEvent();
}
}
public void First()
{
Debug.Log("Jojo");
}
public void Two()
{
Debug.Log("Jojo2");
}
}