public void LoadDelayed() { //Pause button now works if escape is pressed since we are no longer in Main menu. inMainMenu = false; //Hide the main menu UI element showPanels.HideOptionsPanel(); showPanels.HideMenu(); //Load the selected scene, by scene index number in build settings SceneManager.LoadScene(sceneToStart); }
public void BackButtonActions() { int sceneID = SceneManager.GetActiveScene().buildIndex; // get active scene // if not start scene => load home (from grids and shop) if (sceneID != 0) { SceneManager.LoadScene(0); } else if (sceneID == 0 && showPanels.isMenuOpen) { // QuitApplication is appended to this go gameObject.GetComponent <QuitApplication>().Quit(); Debug.Log("quit time"); } else { // on start go back to main menu showPanels.HideOptionsPanel(); showPanels.HideStylePanel(); showPanels.HideCustomPanel(); showPanels.ShowMenu(); } }
private ShowPanels showPanels; //Reference to ShowPanels script on UI GameObject, to show and hide panels void Awake() { //Get a reference to ShowPanels attached to UI object showPanels = GetComponent <ShowPanels> (); //Get a reference to PlayMusic attached to UI object playMusic = GetComponent <PlayMusic> (); showPanels.HideOptionsPanel(); }
public void LoadDelayedOptionsMenuHide() { //show the main menu UI element StartCoroutine(FadeCanvasGroupAlpha(1f, 0f, fadeOutImageCanvasGroup)); showPanels.HideOptionsPanel(); Debug.Log("LoadDelayedOptionsMenuHide"); }
void Option() { if (Input.GetAxis("DPADY") == -1 && CheckDelay()) { audioSelection++; if (audioSelection >= 4) { audioSelection = 1; } Sliders(); } if (Input.GetAxis("DPADY") == 1 && CheckDelay()) { audioSelection--; if (audioSelection <= 0 && !lockSpeed) { audioSelection = 2; } Sliders(); } if (Input.GetAxis("DPADX") == -1 && CheckDelay()) { if (audioSelection == 1) { musicSlider.GetComponent <Slider>().value -= change; } if (audioSelection == 2) { sfxSlider.GetComponent <Slider>().value -= change; } } if (Input.GetAxis("DPADX") == 1 && CheckDelay()) { if (audioSelection == 1) { musicSlider.GetComponent <Slider>().value += change; } if (audioSelection == 2) { sfxSlider.GetComponent <Slider>().value += change; } } if (Input.GetButtonDown("Fire1") && audioSelection == 3 && CheckDelay()) { sfxSlider.GetComponent <Slider>().image.color = new Color32(255, 255, 255, 255); musicSlider.GetComponent <Slider>().image.color = new Color32(255, 255, 255, 255); sp.HideOptionsPanel(); options = false; } }
void Update() { if (Input.GetKeyDown(KeyCode.DownArrow) || Input.GetKeyDown(KeyCode.RightArrow)) { if (index < totalButtons - 1) { index++; selection = (selection + 1) % hands.Count; } } if (Input.GetKeyDown(KeyCode.UpArrow) || Input.GetKeyDown(KeyCode.LeftArrow)) { if (index > 0) { index--; selection = (selection - 1) % hands.Count; } } if (Input.GetKeyDown(KeyCode.Return)) { for (int i = 0; i < hands.Count; i++) { if (i == selection && hands[i].name == "StartHand") { startOp.StartButtonClicked(); } else if (i == selection && hands[i].name == "ControlsHand") { showPanels.ShowOptionsPanel(); } else if (i == selection && hands[i].name == "ExitHand") { showPanels.HideOptionsPanel(); } else if (i == selection && hands[i].name == "QuitHand") { quitApp.Quit(); } else if (i == selection && hands[i].name == "ResumeHand") { pause.UnPause(); } else if (i == selection && hands[i].name == "RestartHand") { SceneManager.LoadScene(1); } } } UpdateSelection(); }
void Awake() { //Get a reference to ShowPanels attached to UI object showPanels = GetComponent <ShowPanels> (); //Get a reference to PlayMusic attached to UI object playMusic = GetComponent <PlayMusic> (); uiManager.pause(true); //Load saved music options if they are set SavedVariables savedVariables = GameObject.Find("DontDestroy").GetComponent <SavedVariables>(); if (savedVariables.set) { showPanels.ShowOptionsPanel(); GameObject.FindGameObjectWithTag("Slider").GetComponent <Slider>().value = savedVariables.sliderValue; GameObject.FindGameObjectWithTag("Toggle").GetComponent <Toggle>().isOn = savedVariables.toggleValue; showPanels.HideOptionsPanel(); } }