public void BackToMainMenu() { if (gameSettings.valueChanged) { string title = "UNSAVED CHANGES"; string message = "There are unsaved changes in the settings. Would you like to apply them first?"; UnityAction yesAction = () => { ApplySettings(); mainMenuHandler.GoToMainMenu(); Destroy(mainMenuHandler.dialogInstance); MainMenuHandler.EnableInputReceive(); }; UnityAction noAction = () => { ResetSettings(); mainMenuHandler.GoToMainMenu(); Destroy(mainMenuHandler.dialogInstance); MainMenuHandler.EnableInputReceive(); }; mainMenuHandler.ShowConfirmDialog(title, message, yesAction, noAction); } else { mainMenuHandler.GoToMainMenu(); } }
public void ExitButton() { string title = "EXIT"; string message = "Are you sure you want to quit?"; UnityAction yesAction = ExitConfirm; UnityAction noAction = ExitDecline; mainMenuHandler.ShowConfirmDialog(title, message, yesAction, noAction); }
public void BackButton() { string title = "LEAVE GAME"; string message = "Do you really want to leave this game?"; if (Network.isServer) { message += " The server will be closed and all other players will automatically be kicked out of the server."; } UnityAction yesAction = BackConfirm; UnityAction noAction = BackDecline; mainMenuHandler.ShowConfirmDialog(title, message, yesAction, noAction); }