public void QuitGame() { if (SceneManager.GetActiveScene().name == "DungeonMultiplayer") { RaidSceneManager.Instanse.OnSceneLeave(); PhotonGameManager.Instanse.LeaveRoom(); WindowClosed(); return; } else if (SceneManager.GetActiveScene().name == "EstateManagement") { EstateSceneManager.Instanse.OnSceneLeave(); DarkestDungeonManager.SaveData.UpdateFromEstate(); DarkestDungeonManager.Instanse.SaveGame(); } else if (SceneManager.GetActiveScene().name == "Dungeon") { if (!RaidSceneManager.HasAnyEvents) { DarkestDungeonManager.SaveData.UpdateFromRaid(); DarkestDungeonManager.Instanse.SaveGame(); } RaidSceneManager.Instanse.OnSceneLeave(); } DarkestSoundManager.SilenceNarrator(); Application.Quit(); }
public void ReturnToCampaignSelection() { if (SceneManager.GetActiveScene().name == "DungeonMultiplayer") { WindowClosed(); RaidSceneManager.Instanse.AbandonButtonClicked(); return; } else if (SceneManager.GetActiveScene().name == "EstateManagement") { EstateSceneManager.Instanse.OnSceneLeave(); DarkestDungeonManager.SaveData.UpdateFromEstate(); DarkestDungeonManager.Instanse.SaveGame(); } else if (SceneManager.GetActiveScene().name == "Dungeon") { if (!RaidSceneManager.HasAnyEvents) { DarkestDungeonManager.SaveData.UpdateFromRaid(); DarkestDungeonManager.Instanse.SaveGame(); } RaidSceneManager.Instanse.OnSceneLeave(); } DarkestSoundManager.SilenceNarrator(); SceneManager.LoadScene("CampaignSelection"); WindowClosed(); }