private void UpdateDeadInfected() { for (int i = killList.Count - 1; i >= 0; --i) { if (killList[i].infectedType == InfectedSpecialType.KAMIKAZE) { GameObject newExplosion = (GameObject)Instantiate(explosion, killList[i].transform.position, killList[i].transform.rotation); } else if (killList[i].infectedType == InfectedSpecialType.MINE) { GameObject newExplosion = (GameObject)Instantiate(explosion, killList[i].transform.position, killList[i].transform.rotation); newExplosion.transform.localScale *= 3.5f; } else { SpawnNucleus(killList[i]); } ui.AddScore(killList[i].scoreWorth); currentKills++; Destroy(killList[i].gameObject); killList.Remove(killList[i]); } }
void Die() { ui.AddScore(scoreWorth); Destroy(gameObject); }