void Update (){ switch (currentState){ case Menu.SupportBay: supportBayMenu.enabled = true; optionsMenu.enabled = false; inputOptionsMenu.enabled = false; supportBayMenu.CheckInput(); if (Input.GetButtonDown("Pause") && Time.time > optionsLastHit + 0.25){ currentState = Menu.Options; optionsLastHit = Time.time; } break; case Menu.ConfirmBuyEquipable: confirmBuyMenu.enabled = true; confirmBuyMenu.CheckInput(); break; case Menu.Options: optionsMenu.enabled = true; inputOptionsMenu.enabled = false; confirmBuyMenu.enabled = false; optionsMenu.CheckInput(); supportBayMenu.UnClickAll(); confirmBuyMenu.UnClickAll(); inputOptionsMenu.UnClickAll(); if (Input.GetButtonDown("joystick button 7") || Input.GetButtonDown("Pause")){ currentState = Menu.SupportBay; optionsMenu.UnClickAll(); } break; case Menu.InputOptions: optionsMenu.enabled = false; inputOptionsMenu.enabled = true; confirmBuyMenu.enabled = false; optionsMenu.CheckInput(); supportBayMenu.UnClickAll(); confirmBuyMenu.UnClickAll(); optionsMenu.UnClickAll(); if (Input.GetButtonDown("joystick button 7") || Input.GetButtonDown("Pause")){ currentState = Menu.SupportBay; optionsMenu.UnClickAll(); } optionsLastHit = Time.time; break; } }
void Update() { switch (currentMenuState) { case MainMenuState.mainMenu: mainMenu.enabled = true; optionsMenu.enabled = false; inputMenu.enabled = false; mainMenu.CheckInput(); break; case MainMenuState.optionsMenu: mainMenu.enabled = false; optionsMenu.enabled = true; inputMenu.enabled = false; optionsMenu.CheckInput(); if (InputCoordinator.usingController) { if (Input.GetButtonDown("joystick button 1")) { currentMenuState = MainMenuState.mainMenu; } } break; case MainMenuState.inputMenu: mainMenu.enabled = false; optionsMenu.enabled = false; inputMenu.enabled = true; inputMenu.CheckInput(); if (InputCoordinator.usingController) { if (Input.GetButtonDown("joystick button 1")) { currentMenuState = MainMenuState.optionsMenu; } } break; case MainMenuState.soundMenu: break; case MainMenuState.graphicsMenu: break; } }
void Update() { if ((Input.GetButtonDown("Pause") || Input.GetButtonDown("joystick button 7")) && paused == false && Time.realtimeSinceStartup - ltPausedHit > pausedCooldown) { //pause game Time.timeScale = 0; ltPausedHit = Time.realtimeSinceStartup; paused = true; Debug.Log("pause"); mainPauseMenu.enabled = true; currentPausedMenuState = PausedMenuState.mainMenu; } if (Input.GetButtonDown("Pause") && paused == true && Time.realtimeSinceStartup - ltPausedHit > pausedCooldown) { //and unpause Time.timeScale = 1; ltPausedHit = Time.realtimeSinceStartup; paused = false; Debug.Log("unpause"); mainPauseMenu.enabled = false; currentPausedMenuState = PausedMenuState.mainMenu; mainPauseMenu.UnClickAll(); optionsMenu.UnClickAll(); inputMenu.UnClickAll(); } if (paused) { switch (currentPausedMenuState) { case PausedMenuState.mainMenu: mainPauseMenu.enabled = true; optionsMenu.enabled = false; inputMenu.enabled = false; mainPauseMenu.CheckInput(); break; case PausedMenuState.optionsMenu: mainPauseMenu.enabled = false; optionsMenu.enabled = true; inputMenu.enabled = false; optionsMenu.CheckInput(); if (InputCoordinator.usingController) { if (Input.GetButtonDown("joystick button 1")) { currentPausedMenuState = PausedMenuState.mainMenu; optionsMenu.UnClickAll(); } } if (InputCoordinator.usingMouseAndKeyboard) { } break; case PausedMenuState.inputMenu: mainPauseMenu.enabled = false; optionsMenu.enabled = false; inputMenu.enabled = true; inputMenu.CheckInput(); if (InputCoordinator.usingController) { if (Input.GetButtonDown("joystick button 1")) { currentPausedMenuState = PausedMenuState.optionsMenu; inputMenu.UnClickAll(); } } if (InputCoordinator.usingMouseAndKeyboard) { } break; } } }
void Update() { mainMenu.enabled = false; confirmMenu.enabled = false; pauseMenu.enabled = false; optionsMenu.enabled = false; inputMenu.enabled = false; if (Input.GetButtonDown("Pause") && Time.time - pausedCooldown > pausedLastHit && paused == false && currentStarmapMenuState != StarmapMenuState.confirmMenu) { paused = true; currentStarmapMenuState = StarmapMenuState.pauseMenu; pausedLastHit = Time.time; } else if (Input.GetButtonDown("Pause") && Time.time - pausedCooldown > pausedLastHit && paused == true && currentStarmapMenuState != StarmapMenuState.confirmMenu) { paused = false; currentStarmapMenuState = StarmapMenuState.mainMenu; pausedLastHit = Time.time; mainMenu.UnClickAll(); confirmMenu.UnClickAll(); pauseMenu.UnClickAll(); optionsMenu.UnClickAll(); inputMenu.UnClickAll(); } switch (currentStarmapMenuState) { case StarmapMenuState.mainMenu: mainMenu.enabled = true; mainMenu.CheckInput(); break; case StarmapMenuState.confirmMenu: confirmMenu.enabled = true; confirmMenu.CheckInput(); confirmMenu.buttons[0].text = destinationName; mainMenu.UnClickAll(); pauseMenu.UnClickAll(); optionsMenu.UnClickAll(); inputMenu.UnClickAll(); if (InputCoordinator.usingController) { if (Input.GetButtonDown("joystick button 1")) { currentStarmapMenuState = StarmapMenuState.mainMenu; } } if (InputCoordinator.usingMouseAndKeyboard) { if (Input.GetButtonDown("Pause")) { currentStarmapMenuState = StarmapMenuState.mainMenu; } } break; case StarmapMenuState.pauseMenu: pauseMenu.enabled = true; pauseMenu.CheckInput(); break; case StarmapMenuState.optionsMenu: optionsMenu.enabled = true; optionsMenu.CheckInput(); if (InputCoordinator.usingController) { if (Input.GetButtonDown("joystick button 1")) { currentStarmapMenuState = StarmapMenuState.pauseMenu; } } break; case StarmapMenuState.inputMenu: inputMenu.enabled = true; inputMenu.CheckInput(); if (InputCoordinator.usingController) { if (Input.GetButtonDown("joystick button 1")) { currentStarmapMenuState = StarmapMenuState.optionsMenu; } } break; } }