Esempio n. 1
0
    public void TryToShoot()
    {
        if (currentBullets <= 0)
        {
            OnBulletCountChange?.Invoke(currentBullets);
            OnFireFailed.Invoke();
            return;
        }
        currentBullets--;

        projectileSpawner.SpawnProjectile();
        OnBulletCountChange?.Invoke(currentBullets);
        OnFireSucceded?.Invoke();
    }
Esempio n. 2
0
 /// <summary>
 /// Invokes the OnFireFailed event
 /// </summary>
 public void InvokeOnFireFailed <T>(T sender)
 {
     Debug.Log($"[{Time.time}] OnFireFailed Invoked by {sender.ToString()}");
     OnFireFailed?.Invoke();
 }