public void EndGame(int score) { gameScore = score; menuDisplay = MenuScreens.Highscore; scoreLogged = false; SceneManager.LoadScene(0); }
// Switch between level selection-, creditsmenu and so on. private void SwitchMenu(MenuScreens menu) { switch (menu) { case MenuScreens.MainMenu: maxIndex = 2; currentOptions = OptionsMainMenu; currentSelected = SelectedMainMenu; break; case MenuScreens.Credits: maxIndex = 1; currentOptions = OptionsCredits; currentSelected = SelectedCredits; break; default: // Enumeratoren er ikke traditionel, returner for at forhindre en ulykke. return; } currentIndex = 0; for (int i = 0; i < Valgmuligheder.Length; i++) { if (currentOptions.Length > i) { Valgmuligheder[i].text = OptionPrepend + currentOptions[i]; continue; } Valgmuligheder[i].text = ""; } SelectMenu(currentIndex); }
void Start() { Time.timeScale = 1; currentScreen = MenuScreens.mainmenu; DeActive(); //for desable all screen MainMenuParent.SetActive(true); //for main menu screen active }
public void changeMenuScreen(bool right) { activeMenuItem = 0; if (right) { if (activeMenuScreen == MenuScreens.Data) { activeMenuScreen = MenuScreens.Inv; } else if (activeMenuScreen == MenuScreens.Inv) { activeMenuScreen = MenuScreens.Stats; } else if (activeMenuScreen == MenuScreens.Stats) { activeMenuScreen = MenuScreens.Data; } } else { if (activeMenuScreen == MenuScreens.Data) { activeMenuScreen = MenuScreens.Stats; } else if (activeMenuScreen == MenuScreens.Inv) { activeMenuScreen = MenuScreens.Data; } else if (activeMenuScreen == MenuScreens.Stats) { activeMenuScreen = MenuScreens.Inv; } } }
//void DoPlayStart() //{ // GameController.Static.currentGameState = GameController.GameState.gameplay; // MainMenuParent.SetActive(false); // InGameUi.SetActive(true); // CameraFade.current.FadeIn(null, 1f, 0f); //} public void OnButtonClick(string ButtonName) { switch (ButtonName) { case "Play": // start intro animation, enable ingameUI CameraFade.current.FadeOut(CameraFade.current.FadeInTest, 0.3f, 0f); GameController.Static.OnGameStart(); SoundController.Static.playSoundFromName("Click"); MainMenuParent.SetActive(false); InGameUi.SetActive(true); TotalCoinsParent.SetActive(false); break; case "PlayerSelect": CameraFade.current.FadeOut(CameraFade.current.FadeInTest, 0.3f, 0f); Invoke("OpenPlayerSelection", 0.2f); break; case "Credits": SoundController.Static.playSoundFromName("Click"); MainMenuParent.SetActive(false); CreditsMenuParent.SetActive(true); TotalCoinsParent.SetActive(false); currentScreen = MenuScreens.CredtsMenu; break; case "Exit": SoundController.Static.playSoundFromName("Click"); ExitParent.SetActive(true); MainMenuParent.SetActive(false); TotalCoinsParent.SetActive(false); Application.Quit(); break; case "Store": CameraFade.current.FadeOut(CameraFade.current.FadeInTest, 0.3f, 0f); Invoke("OpenUpgradesMenu", 0.2f); break; case "Missions": //CameraFade.current.FadeOut(CameraFade.current.FadeInTest, 0.3f, 0f); Invoke("OpenMissionsMenu", 0.2f); break; case "Settings": //CameraFade.current.FadeOut(CameraFade.current.FadeInTest, 0.3f, 0f); Invoke("OpenSettingsMenu", 0.2f); break; case "PauseMenu": //CameraFade.current.FadeOut(CameraFade.current.FadeInTest, 0.3f, 0f); SettingsMenuParent.SetActive(true); MainMenuParent.SetActive(false); TotalCoinsParent.SetActive(false); SoundController.Static.playSoundFromName("Click"); currentScreen = MenuScreens.PauseMenu; break; } }
void OpenSettingsMenu() { SettingsMenuParent.SetActive(true); MainMenuParent.SetActive(false); TotalCoinsParent.SetActive(false); SoundController.Static.playSoundFromName("Click"); currentScreen = MenuScreens.SettingsMenu; }
public void GoBack() { if (prevScreen != MenuScreens.Main && Globals.Instance.currentScreen != MenuScreens.Options) { prevScreen = MenuScreens.Main; } ChangeMenuState(prevScreen); }
void Start() { currentState = MenuScreens.Main; leftButton.SetActive(false); rightButton.SetActive(false); UpdateUpgradeValues(); }
void OpenUpgradesMenu() { PlayerSelectionmenuParent.SetActive(false); UpgradesMenuParent.SetActive(true); MainMenuParent.SetActive(false); TotalCoinsParent.SetActive(true); SoundController.Static.playSoundFromName("Click"); currentScreen = MenuScreens.StoreMenu; }
void OpenPlayerSelection() { MainMenuParent.SetActive(false); PlayerSelectionWithCamera.SetActive(true); PlayerSelectionmenuParent.SetActive(true); TotalCoinsParent.SetActive(true); SoundController.Static.playSoundFromName("Click"); currentScreen = MenuScreens.playerSelectionMenu; }
void Start() { currentScreen = MenuScreens.mainmenu; DeActive(); if (MenuHelper._Instance.restartFromGameplay == 0) { MainMenuParent.SetActive(true); } }
public void CharacterSelectToMain() { currentScreen = MenuScreens.Main; menuAnimator.SetBool("CharacterSelectLoad", false); if (currentMatch != null) { currentMatch.LeaveMatch(); currentMatch = null; } }
private void Init() { prevScreen = Globals.Instance.currentScreen = MenuScreens.Default; trash = GameObject.FindGameObjectWithTag("Trash"); trash.SetActive(false); LoadStrategy(); ShutdownScreens(); ChangeMenuState(MenuScreens.Main); }
/// <summary> /// Creates basic enigma machine, sets debug flag if debug is on, and calls MainMenu with greeting. /// </summary> /// <param name="args">Command line arguments. None implemented.</param> public static void Main(string[] args) { Debug.LogMethodStart(); // Set current to default so program can be used immediately EnigmaMachine.Current = new EnigmaMachine(new EnigmaSettings()); #if DEBUG Utility.isDebugOn = true; #endif MenuScreens.MainMenu(shouldGreet: true); Utility.CloseProgram(); }
public void RotateCameraToUpgradeScreen() { currentState = MenuScreens.UpgradesShop; Tween.Rotation(Camera.main.transform, new Vector3(0, -90, 0), 1, 0, Tween.EaseInOut, Tween.LoopType.None, () => ActivateRightButton()); }
public void ChangeMenuState(MenuScreens newScreen) { var unityObjects = Globals.Instance.UnityObjects; prevScreen = Globals.Instance.currentScreen; switch (prevScreen) { case MenuScreens.Main: unityObjects["ScreenMenu"].SetActive(false); break; case MenuScreens.MultiPlayer: unityObjects["ScreenMultiplayer"].SetActive(false); break; case MenuScreens.StudentInfo: unityObjects["ScreenStudentInfo"].SetActive(false); break; case MenuScreens.Options: unityObjects["ScreenOptions"].SetActive(false); break; //case MenuScreens.Loading: unityObjects["ScreenLoading"].SetActive(false); break; case MenuScreens.Edit: unityObjects["ScreenEdit"].SetActive(false); unityObjects["TitleGameImg"].SetActive(false); trash.SetActive(false); ToggleMenuWindow(true); StrategyEditor.Instance.DisableDragSprite(); StrategyEditor.IsInEdit = false; break; default: break; } Globals.Instance.currentScreen = newScreen; switch (Globals.Instance.currentScreen) { case MenuScreens.Main: unityObjects["ScreenMenu"].SetActive(true); GameView.SetText("TitleMenu", "Main Menu"); break; case MenuScreens.MultiPlayer: if (Application.internetReachability == NetworkReachability.NotReachable) { Globals.Instance.UnityObjects["ErrorWindow"].SetActive(true); GameView.SetText("ErrorTxt", "No Internet Connection !"); } else { unityObjects["ScreenMultiplayer"].SetActive(true); GameView.SetText("TitleMenu", "Multiplayer"); } break; case MenuScreens.StudentInfo: unityObjects["ScreenStudentInfo"].SetActive(true); GameView.SetText("TitleMenu", "Student Info"); break; case MenuScreens.Options: unityObjects["ScreenOptions"].SetActive(true); GameView.SetText("TitleMenu", "Options"); break; case MenuScreens.Edit: unityObjects["ScreenEdit"].SetActive(true); unityObjects["TitleGameImg"].SetActive(true); trash.SetActive(true); GameView.SetText("TitleMenu", "Edit mode"); ToggleMenuWindow(false); StrategyEditor.IsInEdit = true; break; default: break; } }
public void LoadStart() { currentScreen = MenuScreens.First; menuAnimator.SetBool("FirstLoad", true); }
// ___ ___ _ ___ ___ // | \/ | (_) | \/ | // | . . | __ _ _ _ __ | . . | ___ _ __ _ _ // | |\/| |/ _` | | '_ \ | |\/| |/ _ \ '_ \| | | | // | | | | (_| | | | | | | | | | __/ | | | |_| | // \_| |_/\__,_|_|_| |_| \_| |_/\___|_| |_|\__,_| public void GoToMainMenu() { currentScreen = MenuScreens.Main; menuAnimator.SetBool("MainLoad", true); }
// _____ _ _ _____ _ _ _ // / __ \ | | | / ___| | | | | (_) // | / \/ |__ __ _ _ __ __ _ ___| |_ ___ _ __ \ `--. ___| | ___ ___| |_ _ ___ _ __ // | | | '_ \ / _` | '__/ _` |/ __| __/ _ \ '__| `--. \/ _ \ |/ _ \/ __| __| |/ _ \| '_ \ // | \__/\ | | | (_| | | | (_| | (__| || __/ | /\__/ / __/ | __/ (__| |_| | (_) | | | | // \____/_| |_|\__,_|_| \__,_|\___|\__\___|_| \____/ \___|_|\___|\___|\__|_|\___/|_| |_| public void GoToCharacterSelect() { currentScreen = MenuScreens.Character; menuAnimator.SetBool("CharacterSelectLoad", true); }
// _____ _ _ _ // / ___| | | | | (_) // \ `--. ___| |_| |_ _ _ __ __ _ ___ // `--. \/ _ \ __| __| | '_ \ / _` / __| // /\__/ / __/ |_| |_| | | | | (_| \__ \ // \____/ \___|\__|\__|_|_| |_|\__, |___/ // __/ | // |___/ public void GoToSettings() { currentScreen = MenuScreens.Settings; menuAnimator.SetBool("SettingsLoad", true); }
public void ReturnToMenu() { menuDisplay = MenuScreens.Main; SceneManager.LoadScene(0); }
void Update() { if (GameController.Static.currentGameState == GameController.GameState.gameplay) { return; } switch (currentScreen) { case MenuScreens.mainmenu: TotalCoinsParent.SetActive(false); if (Input.GetKeyDown(KeyCode.Escape)) { //DeActive(); ExitParent.SetActive(true); } break; case MenuScreens.playerSelectionMenu: if (Input.GetKeyDown(KeyCode.Escape)) { DeActive(); //FindObjectOfType<PlayerController>().InstantiateSelectedPlayer(); why doesnt this work after purchasing a player??? fuuuck MainMenuParent.SetActive(true); } break; case MenuScreens.ControlselectionMenu: if (Input.GetKeyDown(KeyCode.Escape)) { DeActive(); LevelSelectionMenuParent.SetActive(true); currentScreen = MenuScreens.LevelSelectionMenu; //TotalCoinsParent.SetActive(true); } break; case MenuScreens.CredtsMenu: if (Input.GetKeyDown(KeyCode.Escape)) { DeActive(); MainMenuParent.SetActive(true); } break; case MenuScreens.ByPopupMenu: if (Input.GetKeyDown(KeyCode.Escape)) { DeActive(); PlayerSelectionmenuParent.SetActive(true); } break; case MenuScreens.UnSufficentCoinsMenu: if (Input.GetKeyDown(KeyCode.Escape)) { DeActive(); MainMenuParent.SetActive(true); } break; case MenuScreens.LevelSelectionMenu: if (Input.GetKeyDown(KeyCode.Escape)) { DeActive(); PlayerSelectionmenuParent.SetActive(true); currentScreen = MenuScreens.playerSelectionMenu; } break; case MenuScreens.StoreMenu: if (Input.GetKeyDown(KeyCode.Escape)) { DeActive(); MainMenuParent.SetActive(true); } break; case MenuScreens.InnAppmenu: if (Input.GetKeyDown(KeyCode.Escape)) { DeActive(); MainMenuParent.SetActive(true); } break; case MenuScreens.Missions: if (Input.GetKeyDown(KeyCode.Escape)) { DeActive(); MainMenuParent.SetActive(true); } break; } }
public void RotateCameraToLevelSelection() { currentState = MenuScreens.LevelSelection; Tween.Rotation(Camera.main.transform, new Vector3(0, 90, 0), 1, 0, Tween.EaseInOut, Tween.LoopType.None, () => ActivateLeftButton()); }
void Update() { if (GameController.Static.currentGameState == GameController.GameState.gameplay) { return; } Debug.Log("HUEHUEHUE"); switch (currentScreen) { case MenuScreens.mainmenu: Debug.Log("main menu enumerator"); if (Input.GetKeyDown(KeyCode.Escape)) { DeActive(); } break; case MenuScreens.playerSelectionMenu: if (Input.GetKeyDown(KeyCode.Escape)) { DeActive(); MainMenuParent.SetActive(true); } break; case MenuScreens.ControlselectionMenu: if (Input.GetKeyDown(KeyCode.Escape)) { DeActive(); LevelSelectionMenuParent.SetActive(true); currentScreen = MenuScreens.LevelSelectionMenu; TotalCoinsParent.SetActive(true); } break; case MenuScreens.CredtsMenu: if (Input.GetKeyDown(KeyCode.Escape)) { DeActive(); MainMenuParent.SetActive(true); } break; case MenuScreens.ByPopupMenu: if (Input.GetKeyDown(KeyCode.Escape)) { DeActive(); PlayerSelectionParent.SetActive(true); } break; case MenuScreens.UnSufficentCoinsMenu: if (Input.GetKeyDown(KeyCode.Escape)) { DeActive(); MainMenuParent.SetActive(true); } break; case MenuScreens.LevelSelectionMenu: if (Input.GetKeyDown(KeyCode.Escape)) { DeActive(); PlayerSelectionParent.SetActive(true); currentScreen = MenuScreens.playerSelectionMenu; } break; case MenuScreens.StoreMenu: if (Input.GetKeyDown(KeyCode.Escape)) { DeActive(); MainMenuParent.SetActive(true); } break; case MenuScreens.InnAppmenu: if (Input.GetKeyDown(KeyCode.Escape)) { DeActive(); MainMenuParent.SetActive(true); } break; case MenuScreens.Missions: if (Input.GetKeyDown(KeyCode.Escape)) { DeActive(); MainMenuParent.SetActive(true); } break; } }
public void RotateCameraToMainMenu() { currentState = MenuScreens.Main; Tween.Rotation(Camera.main.transform, new Vector3(0, 0, 0), 1, 0, Tween.EaseInOut, Tween.LoopType.None, () => DeactivateRightLeftButton()); }