public void BackToMain() { //Debug.Log("Back to Main Menu."); if (MainMenuAnimator.GetCurrentAnimatorStateInfo(0).IsName("LevelSelect")) { MainMenuAnimator.SetTrigger("LeaveLevelSelect"); } else if (MainMenuAnimator.GetCurrentAnimatorStateInfo(0).IsName("HowtoPlay")) { MainMenuAnimator.SetTrigger("LeaveHTP"); } else if (MainMenuAnimator.GetCurrentAnimatorStateInfo(0).IsName("Credits")) { MainMenuAnimator.SetTrigger("LeaveCredits"); } else if (MainMenuAnimator.GetCurrentAnimatorStateInfo(0).IsName("Settings")) { // Save volumes from TempVolumeControl to SoundManager Master Volumes SoundManager.SetMasterVolumes(MixerControl.MusicVolume, MixerControl.SoundVolume); MainMenuAnimator.SetTrigger("LeaveSettings"); } }
public void RightArrowButton() { //Debug.Log("This is the right arrow button."); if (MainMenuAnimator.GetCurrentAnimatorStateInfo(0).IsName("HowtoPlay")) { htpIndex++; if (htpIndex > htpMenus.Length - 1) { htpIndex = 0; } for (int i = 0; i < htpMenus.Length; i++) { if (i == htpIndex) { if (!htpMenus[i].activeSelf) { htpMenus[i].SetActive(true); } } else { if (htpMenus[i].activeSelf) { htpMenus[i].SetActive(false); } } } } else if (MainMenuAnimator.GetCurrentAnimatorStateInfo(0).IsName("LevelSelect")) { levelIndex++; if (levelIndex > SceneManager.sceneCountInBuildSettings - 1) { levelIndex = 1; } EditLevelInfo(LevelInformation.Levels[levelIndex].displayName, LevelInformation.Levels[levelIndex].levelLocked, LevelInformation.Levels[levelIndex].stars, LevelInformation.Levels[levelIndex].gems, LevelInformation.Levels[levelIndex].gemsAcquired); } else if (MainMenuAnimator.GetCurrentAnimatorStateInfo(0).IsName("Credits")) { creditsIndex++; if (creditsIndex > creditsMenus.Length - 1) { creditsIndex = 0; } for (int i = 0; i < creditsMenus.Length; i++) { if (i == creditsIndex) { if (!creditsMenus[i].activeSelf) { creditsMenus[i].SetActive(true); } } else { if (creditsMenus[i].activeSelf) { creditsMenus[i].SetActive(false); } } } } }