private void CreateWaves(StageConfig stageConfig, DefaultStage stage, DungeonLogic dungeonLogic) { List <WaveConfig> waves = stageConfig.WaveList(); for (int waveIndex = 0; waveIndex < waves.Count; waveIndex++) { WaveConfig w = waves[waveIndex]; if (w.IsDisabled()) { continue; } DefaultWaveLogic waveLogic = new DefaultWaveLogic(waveIndex + 1); List <ChallengeConfig> challengeConfigs = w.ChallengeList(); for (int challengeIndex = 0; challengeIndex < challengeConfigs.Count; challengeIndex++) { ChallengeConfig challengeConfig = challengeConfigs[challengeIndex]; if (challengeConfig.IsDisabled()) { continue; } ActionsByLayer actionsByLayer = CreateActionsByLayer(challengeConfig.SpawnConfig().ActionConfigs(), dungeonLogic); Challenge challenge = CreateChallenge(challengeConfig, actionsByLayer.allActions, dungeonLogic); // challenge.Name = (waveIndex + 1) + "-" + (challengeIndex + 1); waveLogic.AddChallenge(challenge); foreach (IAction stageAction in actionsByLayer.stageActions) { stage.AddAction(stageAction); } foreach (IAction dungeonAction in actionsByLayer.dungeonActions) { dungeonLogic.AddAction(dungeonAction); } } stage.AddWave(waveLogic); } }