public void Instructions() { gameObject.SetActive(false); InstructionsPanel.SetActive(true); MainMenuPanel.SetActive(false); PausePanel.SetActive(false); Console.WriteLine("Instructions menu controller"); }
void Awake() { instructionsPanel = InstructionsPanel.Instance(); appearanceAction = new UnityAction(AppearanceFunction); personalAction = new UnityAction(PersonalFunction); socialAction = new UnityAction(SocialFunction); }
void OnLevelWasLoaded() { if (GameManager.s_instance.isReturningFromModule) { GameManager.s_instance.isReturningFromModule = false; //modulesMenuAnimator = modulesMenu.GetComponent<Animator>(); modulesMenuAnimator.SetTrigger("menuTrigger"); InstructionsPanel modulesMenuInstructionsPanel = modulesMenu.GetComponent <InstructionsPanel> (); /* Order of levels as slides: * 0 POS * 1 Apparent Wind * 2 Trim * 3 Tack * 4 RoW * 5 Dock * 6 MOB * 7 Nav */ int goToPanelIndex = 0; switch (GameManager.s_instance.lastLevelState) { case GameManager.LevelState.POS: goToPanelIndex = 0; break; case GameManager.LevelState.SailTrim: goToPanelIndex = 2; break; case GameManager.LevelState.ApparentWind: goToPanelIndex = 1; break; case GameManager.LevelState.LearnToTack: goToPanelIndex = 3; break; case GameManager.LevelState.Docking: goToPanelIndex = 5; break; case GameManager.LevelState.Navigation: goToPanelIndex = 6; break; case GameManager.LevelState.RightOfWay: goToPanelIndex = 4; break; } GameObject goToPanel = modulesMenu.transform.GetChild(0).GetChild(goToPanelIndex).gameObject; modulesMenuInstructionsPanel.GoToPanel(goToPanel); startPanel.SetActive(false); } }
//Back to main menu public void BackToMenu() { //gameObject.SetActive(false); MainMenuPanel.SetActive(true); PausePanel.SetActive(false); OptionsPanel.SetActive(false); CreditsPanel.SetActive(false); InstructionsPanel.SetActive(false); GameOverPanel.SetActive(false); GameController.Instance.state = eState.TITLE; Console.WriteLine("BacktoMenu menu controller"); }
public void Pause() { if (GameController.Instance.state == eState.GAME) { PausePanel.SetActive(true); MainMenuPanel.SetActive(false); OptionsPanel.SetActive(false); CreditsPanel.SetActive(false); InstructionsPanel.SetActive(false); GameOverPanel.SetActive(false); GameController.Instance.state = eState.PAUSE; } }
public static InstructionsPanel Instance() { if (!instructionsPanel) { instructionsPanel = FindObjectOfType(typeof(InstructionsPanel)) as InstructionsPanel; if (!instructionsPanel) { Debug.LogError("There needs to be one active InstructionsPanel script on a GameObject in your scene."); } } return(instructionsPanel); }
private void Start_Click(object sender, EventArgs e) { InstructionsPanel.Hide(); }