Exemplo 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();
     }
 }
Exemplo 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;
        }
    }
Exemplo n.º 3
0
 public void Kill()
 {
     KillEvent?.Invoke();
     gameObject.SetActive(false);
 }
 public override void Kill(Projectile projectile, int timeLeft)
 {
     KillEvent?.Invoke(projectile, timeLeft);
 }