public void NextRound() { enemiesDead = 0; enemiesSpawned = 0; initSetting(); //GUI gui.UpdateRonda(round); enemyNum += config.DeltaEnemies; float cantidad = probability[0] - config.DeltaProbability[0] < config.MinProbability ? probability[0] - config.MinProbability : config.DeltaProbability[0]; probability[0] -= cantidad; for (int i = 1; i < probability.Length; i++) { probability[i] += cantidad * config.DeltaProbability[i]; } player.unPause(); StartCoroutine("Spawn"); }
void Start() { probability = new float[config.Enemies.Length]; for (int i = 0; i < config.Enemies.Length; i++) { probability[i] = config.InitProbability[i]; } enemyNum = config.InitEnemyNum; round = 1; enemiesDead = 0; enemiesSpawned = 0; initSetting(); player.InitPlayer(this); //GUI gui = GUI.GetComponent <GUImanager>(); gui.UpdateRonda(round); StartCoroutine("Spawn"); }