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