static bool OpenMenu(E_MenuState state) { if (CanChangeToState(state) == false) { return(false); } GuiMenu menu = m_Instance.SetState(state); if (menu == null) { return(false); } m_Instance.UpdateHudVisibility(false); if (menu.IsInitialized == false) { menu.InitMenu(m_Instance); } menu.ShowMenu(); return(true); }
IEnumerator StartSinglePlayerSubMenu() { MenuState = E_MenuState.Busy; yield return(new WaitForSeconds(0.1f)); AudioSource.PlayClipAtPoint(SoundMainMenuOut, Position); MainBackground.GetComponent <Animation>().Play("toSubmenu"); MainLine.GetComponent <Animation>().Play("ButtonLineOut"); SinglePlayer.GetComponent <Animation>().Play("MainButtonsOut"); Dojo.GetComponent <Animation>().Play("MainButtonsOut"); Chapters.GetComponent <Animation>().Play("MainButtonsOut"); Help.GetComponent <Animation>().Play("MainButtonsOut"); MoreGames.GetComponent <Animation>().Play("MainButtonsOut"); GameCenter.GetComponent <Animation>().Play("MainButtonsOut"); yield return(new WaitForSeconds(0.3f)); GameBackground.GetComponent <Animation>().Play("in"); GameTitle.GetComponent <Animation>().Play("TitleIn"); if (Game.Instance.IsResumePossible(E_GameType.SinglePlayer)) { GameResume.GetComponent <Animation>().Play("in"); } GameEasy.GetComponent <Animation>().Play("in"); GameNormal.GetComponent <Animation>().Play("in"); GameHard.GetComponent <Animation>().Play("in"); Back.GetComponent <Animation>().Play("in"); AudioSource.PlayClipAtPoint(SoundSubMenuIn, Position); MenuState = E_MenuState.GameSubmenu; }
IEnumerator StartFromDojo2MainMenu() { MenuState = E_MenuState.Busy; yield return(new WaitForSeconds(0.1f)); AudioSource.PlayClipAtPoint(SoundSubMenuOut, Position); DojoBackground.GetComponent <Animation>().Play("out"); DojoTitle.GetComponent <Animation>().Play("TitleOut"); if (Game.Instance.IsResumePossible(E_GameType.Survival)) { DojoResume.GetComponent <Animation>().Play("out"); } DojoNew.GetComponent <Animation>().Play("out"); Back.GetComponent <Animation>().Play("out"); yield return(new WaitForSeconds(0.3f)); AudioSource.PlayClipAtPoint(SoundMainMenuIn, Position); MainBackground.GetComponent <Animation>().Play("toMainMenu"); MainLine.GetComponent <Animation>().Play("ButtonLineIn"); SinglePlayer.GetComponent <Animation>().Play("MainButtonsIn"); Dojo.GetComponent <Animation>().Play("MainButtonsIn"); Chapters.GetComponent <Animation>().Play("MainButtonsIn"); Help.GetComponent <Animation>().Play("MainButtonsIn"); MoreGames.GetComponent <Animation>().Play("MainButtonsIn"); GameCenter.GetComponent <Animation>().Play("MainButtonsIn"); MenuState = E_MenuState.MainMenu; }
IEnumerator StartFromChapters2MainMenu() { MenuState = E_MenuState.Busy; yield return(new WaitForSeconds(0.1f)); AudioSource.PlayClipAtPoint(SoundSubMenuOut, Position); ChaptersLocked.GetComponent <Animation>().Play("out"); ChaptersBackground.GetComponent <Animation>().Play("out"); ChaptersTitle.GetComponent <Animation>().Play("TitleOut"); int unlockedMissions = Game.Instance.GetUnlockedMission(); for (int i = 0; i < Chapter.Length && i < unlockedMissions; i++) { Chapter[i].GetComponent <Animation>().Play("out"); } Back.GetComponent <Animation>().Play("out"); yield return(new WaitForSeconds(0.1f)); AudioSource.PlayClipAtPoint(SoundMainMenuIn, Position); MainBackground.GetComponent <Animation>().Play("toMainMenu"); MainLine.GetComponent <Animation>().Play("ButtonLineIn"); SinglePlayer.GetComponent <Animation>().Play("MainButtonsIn"); Dojo.GetComponent <Animation>().Play("MainButtonsIn"); Chapters.GetComponent <Animation>().Play("MainButtonsIn"); Help.GetComponent <Animation>().Play("MainButtonsIn"); MoreGames.GetComponent <Animation>().Play("MainButtonsIn"); GameCenter.GetComponent <Animation>().Play("MainButtonsIn"); MenuState = E_MenuState.MainMenu; }
// PRIVATE METHODS static GuiMenu PrepareMenu(E_MenuState state) { if (m_Instance == null) { return(null); } return(m_Instance.SetState(state)); }
IEnumerator StartLeaderboards() { MenuState = E_MenuState.Busy; yield return(new WaitForSeconds(0.2f)); yield return(new WaitForSeconds(0.2f)); MenuState = E_MenuState.MainMenu; }
IEnumerator StartAchievements() { MenuState = E_MenuState.Busy; yield return(new WaitForSeconds(0.2f)); yield return(new WaitForSeconds(0.2f)); MenuState = E_MenuState.MainMenu; }
IEnumerator StartNewDojo() { MenuState = E_MenuState.Busy; yield return(new WaitForSeconds(0.1f)); StartCoroutine(FadeInLoading()); yield return(new WaitForSeconds(0.3f)); Game.Instance.StartSurvivalMode(); }
IEnumerator StartGameCenter() { MenuState = E_MenuState.Busy; yield return(new WaitForSeconds(0.2f)); openFeint.OpenDashboard(); yield return(new WaitForSeconds(0.2f)); MenuState = E_MenuState.MainMenu; }
IEnumerator StartChapter(int index) { MenuState = E_MenuState.Busy; yield return(new WaitForSeconds(0.1f)); FadeOutMusic(4); StartCoroutine(FadeInLoading()); yield return(new WaitForSeconds(0.3f)); Game.Instance.StartChapterMode(index); }
IEnumerator StartNewNormalGame() { MenuState = E_MenuState.Busy; yield return(new WaitForSeconds(0.1f)); StartCoroutine(FadeOutMusic(4)); StartCoroutine(FadeInLoading()); yield return(new WaitForSeconds(0.3f)); Game.Instance.StartNewGame(E_GameDifficulty.Normal); }
static bool GoFromCustomToIdleState(E_MenuState state) { if (m_Instance == null) { return(false); } if (m_Instance.IsInState(state) == false) { return(false); } return(GotoIdleState()); }
IEnumerator StartTutorial() { MenuState = E_MenuState.Busy; yield return(new WaitForSeconds(0.1f)); StartCoroutine(FadeOutMusic(4)); StartCoroutine(FadeInLoading()); yield return(new WaitForSeconds(0.3f)); Game.Instance.StartTutorial(); MenuState = E_MenuState.MainMenu; }
IEnumerator _ShowGameCenter() { MenuState = E_MenuState.Busy; ALBackground.GetComponent <Animation>().Play("AandL_out"); Achievements.GetComponent <Animation>().Play("AandL_out"); Leaderboards.GetComponent <Animation>().Play("AandL_out"); yield return(new WaitForSeconds(0.2f)); ALBackground.GetComponent <Animation>().Play("AandL_in"); GameCenter.GetComponent <Animation>().Play("AandL_in"); MenuState = E_MenuState.MainMenu; }
// PRIVATE METHODS static bool CanChangeToState(E_MenuState state) { if (m_Instance == null) { return(false); } if (m_Instance.IsInState(E_MenuState.Exiting) == true) { return(false); } if (m_Instance.IsInState(state) == true) { return(false); } return(true); }
static bool CloseMenu(E_MenuState state) { if (m_Instance == null) { return(false); } if (m_Instance.IsInState(state) == false) { return(false); } m_Instance.SetState(E_MenuState.Idle); return(true); }
IEnumerator StartMoreGamesSubMenu() { MenuState = E_MenuState.Busy; yield return(new WaitForSeconds(0.1f)); StartCoroutine(FadeOutMusic(4)); // StartCoroutine(FadeInLoading()); yield return(new WaitForSeconds(0.3f)); Application.Quit(); /* * Game.Instance.StartSaleScreens(); * * MenuState = E_MenuState.MainMenu;*/ }
static bool OpenMenu(E_MenuState state) { GuiMenu menu = PrepareMenu(state); if (menu == null) { return(false); } if (menu.IsInitialized == false) { menu.InitMenu(m_Instance); } menu.ShowMenu(); return(true); }
// PRIVATE METHODS void SetMenuState(E_MenuState state) { if (m_MenuState == state) { return; } m_MenuState = state; switch (m_MenuState) { case E_MenuState.Idle: break; case E_MenuState.Menu: break; default: break; } }
void FadeIn() { MenuState = E_MenuState.MainMenu; }