public void BuySkeletonWarrior() { if (health.GetHP() > warriorCost + 1) { // Instanciate Knight SpawnOnClick(SkeletonWarrior); health.TakeDamage(warriorCost); } }
private IEnumerator GameLoop() { if (waveCount == 0) { yield return(StartCoroutine(Picking())); } SpawnWave(waveCount); waveCount++; yield return(StartCoroutine(Fighting())); if (necroMancer.GetHP() >= 0) { StartCoroutine(GameLoop()); } else { EndGame(); } }