void Update() { if (Input.GetKeyDown(KeyCode.UpArrow) && optionSlect >= optionSlectMaxArgument) { optionSlect -= 1; TranforText(); soundManager.PlayFX_MenuMove(); } else if (Input.GetKeyDown(KeyCode.DownArrow) && optionSlect < maxOption) { optionSlect += 1; TranforText(); soundManager.PlayFX_MenuMove(); } if (Input.GetKeyDown(KeyCode.Space) || Input.GetKeyDown(KeyCode.Return)) { switch (optionSlect) { case 0: soundManager.PlayFX_MenuStart(); mainManager.GoToContinueGame(); break; case 1: PlayerPrefs.SetInt("Score", 0); PlayerPrefs.SetInt("Lifes", 2); PlayerPrefs.SetInt("Fuel", 1000); PlayerPrefs.SetInt("Level", 1); PlayerPrefs.SetFloat("Time", 0); PlayerPrefs.SetInt("Continue", 0); soundManager.PlayFX_MenuStart(); mainManager.GoToNewGame(); break; case 2: soundManager.PlayFX_MenuSelect(); mainManager.ChangeMenu(2); break; case 3: soundManager.PlayFX_MenuSelect(); mainManager.ChangeMenu(3); break; default: soundManager.PlayFX_MenuSelect(); mainManager.ChangeMenu(3); break; } } }
void Update() { if (Input.GetKeyDown(KeyCode.UpArrow) && optionSlect >= 1) { optionSlect -= 1; TranforText(); soundManager.PlayFX_MenuMove(); } else if (Input.GetKeyDown(KeyCode.DownArrow) && optionSlect < maxOption) { optionSlect += 1; TranforText(); soundManager.PlayFX_MenuMove(); } if (Input.GetKeyDown(KeyCode.Space) || Input.GetKeyDown(KeyCode.Return)) { switch (optionSlect) { case 0: soundManager.PlayFX_MenuSelect(); ConfSoundOnOff(); break; case 1: soundManager.PlayFX_MenuSelect(); ConfVolumen(); break; case 2: soundManager.PlayFX_MenuBack(); mainManager.ChangeMenu(1); break; default: soundManager.PlayFX_MenuBack(); mainManager.ChangeMenu(1); break; } } }