private void Death() { if (enemyHealthPoint <= 0) { aicc.agent.Stop(); animator.SetTrigger("Death"); spawner.CurrentEnemiesAmount -= 1; fort.addScore(1); isAlive = false; } }
private void Death() { if (enemyHealthPoint <= 0) { aicc.agent.Stop(); animator.SetTrigger("Death"); spawner.CurrentEnemiesAmount -= 1; fort.addScore(1); isAlive = false; if (targetManager.targets.Find(x => x == gameObject) == gameObject) { targetManager.targets.Remove(gameObject); } StartCoroutine("deathDelay"); } }