private IEnumerable <object> Loading() { SubmarineInfo subInfo = new SubmarineInfo(submarinePath); LevelGenerationParams generationParams = LevelGenerationParams.LevelParams.Find(p => p.Identifier.Equals(levelParams, StringComparison.OrdinalIgnoreCase)); yield return(CoroutineStatus.Running);
private IEnumerable <object> Loading() { SubmarineInfo subInfo = new SubmarineInfo(submarinePath); LevelGenerationParams generationParams = LevelGenerationParams.LevelParams.Find(p => p.Identifier.Equals(levelParams, StringComparison.OrdinalIgnoreCase)); yield return(CoroutineStatus.Running); GameMain.GameSession = new GameSession(subInfo, GameModePreset.Tutorial, missionPrefabs: null); (GameMain.GameSession.GameMode as TutorialMode).Tutorial = this; if (generationParams != null) { Biome biome = LevelGenerationParams.GetBiomes().FirstOrDefault(b => generationParams.AllowedBiomes.Contains(b)) ?? LevelGenerationParams.GetBiomes().First(); if (!string.IsNullOrEmpty(startOutpostPath)) { startOutpost = new SubmarineInfo(startOutpostPath); } if (!string.IsNullOrEmpty(endOutpostPath)) { endOutpost = new SubmarineInfo(endOutpostPath); } LevelData tutorialLevel = new LevelData(levelSeed, 0, 0, generationParams, biome); GameMain.GameSession.StartRound(tutorialLevel, startOutpost: startOutpost, endOutpost: endOutpost); } else { GameMain.GameSession.StartRound(levelSeed); } GameMain.GameSession.EventManager.ActiveEvents.Clear(); GameMain.GameSession.EventManager.Enabled = false; GameMain.GameScreen.Select(); yield return(CoroutineStatus.Success); }
private IEnumerable <object> Loading() { Submarine.MainSub = Submarine.Load(submarinePath, "", true); LevelGenerationParams generationParams = LevelGenerationParams.LevelParams.Find(p => p.Name == levelParams); yield return(CoroutineStatus.Running); GameMain.GameSession = new GameSession(Submarine.MainSub, "", GameModePreset.List.Find(g => g.Identifier == "tutorial")); (GameMain.GameSession.GameMode as TutorialMode).Tutorial = this; if (generationParams != null) { Biome biome = LevelGenerationParams.GetBiomes().Find(b => generationParams.AllowedBiomes.Contains(b)); if (startOutpostPath != string.Empty) { startOutpost = Submarine.Load(startOutpostPath, "", false); } if (endOutpostPath != string.Empty) { endOutpost = Submarine.Load(endOutpostPath, "", false); } Level tutorialLevel = new Level(levelSeed, 0, 0, generationParams, biome, startOutpost, endOutpost); GameMain.GameSession.StartRound(tutorialLevel); } else { GameMain.GameSession.StartRound(levelSeed); } GameMain.GameSession.EventManager.Events.Clear(); GameMain.GameSession.EventManager.Enabled = false; GameMain.GameScreen.Select(); yield return(CoroutineStatus.Success); }