Esempio n. 1
0
 public void OnTriggerEnter(Collider other)
 {
     if (other.CompareTag("Bullet"))
     {
         // kill enemy. Destroy bullet object. Invoke EnemyKilled events
         print("Bullets --- My OnLY WeaKNess");
         Destroy(other.gameObject);
         OnEnemyKilled();
         OnEnemyKill.Invoke();
     }
 }
Esempio n. 2
0
    public void OnKillMethod(GameObject unit)
    {
        int amount = unit.GetComponent <Unit>().unitDescirption.goldRevarde;

        KillEvent?.Invoke(amount);

        if (EndRound() && allUnitsSpawned)
        {
            StopAllCoroutines();
            OnRoundEndEvent?.Invoke();
            FindObjectOfType <UiManager>().counter = 20;
            StartCoroutine(StartCounter());
            StartCoroutine(ContinueGame());
            allUnitsSpawned = false;
        }
    }
Esempio n. 3
0
 public void Kill()
 {
     KillEvent?.Invoke();
     gameObject.SetActive(false);
 }
 public override void Kill(Projectile projectile, int timeLeft)
 {
     KillEvent?.Invoke(projectile, timeLeft);
 }