Exemplo n.º 1
0
    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);
    }
Exemplo n.º 2
0
    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;
    }
Exemplo n.º 3
0
    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;
    }
Exemplo n.º 4
0
    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;
    }
Exemplo n.º 5
0
    // PRIVATE METHODS

    static GuiMenu PrepareMenu(E_MenuState state)
    {
        if (m_Instance == null)
        {
            return(null);
        }

        return(m_Instance.SetState(state));
    }
Exemplo n.º 6
0
    IEnumerator StartLeaderboards()
    {
        MenuState = E_MenuState.Busy;
        yield return(new WaitForSeconds(0.2f));

        yield return(new WaitForSeconds(0.2f));

        MenuState = E_MenuState.MainMenu;
    }
Exemplo n.º 7
0
    IEnumerator StartAchievements()
    {
        MenuState = E_MenuState.Busy;
        yield return(new WaitForSeconds(0.2f));

        yield return(new WaitForSeconds(0.2f));

        MenuState = E_MenuState.MainMenu;
    }
Exemplo n.º 8
0
    IEnumerator StartNewDojo()
    {
        MenuState = E_MenuState.Busy;
        yield return(new WaitForSeconds(0.1f));

        StartCoroutine(FadeInLoading());
        yield return(new WaitForSeconds(0.3f));

        Game.Instance.StartSurvivalMode();
    }
Exemplo n.º 9
0
    IEnumerator StartGameCenter()
    {
        MenuState = E_MenuState.Busy;
        yield return(new WaitForSeconds(0.2f));

        openFeint.OpenDashboard();
        yield return(new WaitForSeconds(0.2f));

        MenuState = E_MenuState.MainMenu;
    }
Exemplo n.º 10
0
    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);
    }
Exemplo n.º 11
0
    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);
    }
Exemplo n.º 12
0
    static bool GoFromCustomToIdleState(E_MenuState state)
    {
        if (m_Instance == null)
        {
            return(false);
        }

        if (m_Instance.IsInState(state) == false)
        {
            return(false);
        }

        return(GotoIdleState());
    }
Exemplo n.º 13
0
    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;
    }
Exemplo n.º 14
0
    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;
    }
Exemplo n.º 15
0
    // 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);
    }
Exemplo n.º 16
0
    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);
    }
Exemplo n.º 17
0
    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;*/
    }
Exemplo n.º 18
0
    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);
    }
Exemplo n.º 19
0
    // 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;
        }
    }
Exemplo n.º 20
0
 void FadeIn()
 {
     MenuState = E_MenuState.MainMenu;
 }