public void RefreshLevelRound() { WaveProperty value = current_wave_data.GetWave(current_wave_index); if (current_enemy_id != value.EnemyId) { current_number_enemy_instance_in_a_wave = 0; if (value.IsIncreaseEachLevelRound) { MaxSizeEnemy = Mathf.Clamp(PlayerData.LevelRound * value.EnemyAmount, value.EnemyAmount, GameConfig.MaxEnemyIncreased); } else { MaxSizeEnemy = value.EnemyAmount; } } else { if (value.IsIncreaseEachLevelRound) { MaxSizeEnemy += Mathf.Clamp(PlayerData.LevelRound * value.EnemyAmount, value.EnemyAmount, GameConfig.MaxEnemyIncreased); } else { MaxSizeEnemy = value.EnemyAmount; } } current_enemy_id = value.EnemyId; this.PostActionEvent(ActionEnums.ActionID.TopUIGame_Wave); }
public void ReloadLevel(int level_wave) { if (level_wave > PlayerData.LevelRound) { return; } PlayerData.LevelRound = level_wave; PlayerData.SaveLevelRound(); PlayerData.SaveHighLevelRound(); current_enemy_id = EnemyEnums.EnemyId.None; current_wave_index = 1; current_wave_level = 1; RefreshData(); RefreshLevelRound(); }
public void InstanceEnemy(EnemyEnums.EnemyId enemyId) { switch (enemyId) { case EnemyEnums.EnemyId.Virus: InstanceVirusEnemy(); break; case EnemyEnums.EnemyId.Rock: InstanceRockEnemy(); break; case EnemyEnums.EnemyId.Trap: InstanceTrapEnemy(); break; case EnemyEnums.EnemyId.Boss: InstanceBossEnemy(); break; default: InstanceVirusEnemy(); break; } current_number_enemy_instance_in_a_wave++; if (current_number_enemy_instance_in_a_wave >= MaxSizeEnemy) { current_wave_index++; if (!current_wave_data.IsLastWave(current_wave_index)) { RefreshLevelRound(); } } }