//------------------------------------------------------------
        void Start()
        {
            ARKLogger.LogMessage(eLogCategory.Control,
                                 eLogLevel.Info,
                                 "MainMenu: Starting.");

            StateId = EMainMenuState.Startup;
            ButtonId = EMenuButtonId.None;
        }
Beispiel #2
0
 virtual public void OnHide()
 {
     m_gcMasterGroup.alpha        = 1f;
     m_gcMasterGroup.interactable = false;
     m_goEventSystem.SetActive(false);
     m_iMenuState = EMainMenuState._FADE_MASTER_OUT;
     Messenger.Invoke(Types.s_sMISC_KillAllParticles);
     Cursor.visible = false;
 }
Beispiel #3
0
    virtual public void OnShow()
    {
        m_gcMasterGroup.alpha        = 0f;                                              // <-- inverted because we fade in...
        m_gcMasterGroup.interactable = true;
        m_iMenuState = EMainMenuState._FADE_MASTER_IN;
        m_goEventSystem.SetActive(true);
        m_goCanvas.SetActive(true);

        Cursor.visible = true;
    }
Beispiel #4
0
    virtual public void OnHideInstant()
    {
        m_iMenuState = EMainMenuState._FADE_MASTER_OUT;

        m_gcButtonsGroup.gameObject.SetActive(true);
        m_gcButtonsGroup.alpha        = 1f;
        m_gcButtonsGroup.interactable = true;
        m_gcSettingsGroup.gameObject.SetActive(false);
        m_gcSettingsGroup.alpha        = 0f;
        m_gcSettingsGroup.interactable = false;
        m_gcCreditsGroup.gameObject.SetActive(false);
        m_gcCreditsGroup.alpha        = 0f;
        m_gcCreditsGroup.interactable = false;

        m_goCanvas.SetActive(false);
        m_goEventSystem.SetActive(false);
    }
    void SwitchState(EMainMenuState nextState)
    {
        StateId = nextState;
        print("TUA_MainMenu: - SwitchState: " + StateId);
        switch (StateId)
        {
        case EMainMenuState.Startup:
            if (showCustomLogo)
            {
                // Has the logo been displayed already?
                if (TUA_App.Instance.displayedLogo)
                {
                    // Move to the next state.
                    //mf_screenManager.instance.OpenPanel(mf_screenManager.instance.screens[1], 5, 2.0f);
                    //TUA_ScreenManager.Instance.OpenPanel(TUA_ScreenManager.Instance.GetScreenAnimByName("screen_menu"),TUA_ScreenManager.ScreenTranstitionType.Instant,0f);
                    SwitchState(EMainMenuState.Menu);
                }
                else
                {
                    TUA_ScreenManager.Instance.OpenPanelOverTop(TUA_ScreenManager.Instance.GetScreenAnimByName("screen_logo"), TUA_ScreenManager.ScreenTranstitionType.Instant, 0f);
                    SwitchState(EMainMenuState.DisplayLogo);
                }
            }
            else
            {
                //TUA_ScreenManager.Instance.OpenPanel(TUA_ScreenManager.Instance.GetScreenAnimByName("screen_menu"), TUA_ScreenManager.ScreenTranstitionType.Instant, 0f);
                SwitchState(EMainMenuState.Menu);
            }
            break;

        case EMainMenuState.DisplayLogo:
            //logoGO.SetActive(true);

            logoDisplayTimer = logoDisplayTime;
            TUA_App.Instance.displayedLogo = true;
            break;

        case EMainMenuState.Menu:
            //logoGO.SetActive(false);
            break;
        }
    }
Beispiel #6
0
 public void ShowSettings()
 {
     m_iMenuState = EMainMenuState._FADE_SETTINGS_IN;
 }
Beispiel #7
0
    public void Update()
    {
        switch (m_iMenuState)
        {
        case EMainMenuState._FADE_MASTER_IN:
            m_gcMasterGroup.alpha += Types.s_fDUR_MenuFadeSpeed * TimerManager.fGameDeltaTime;

            if (m_gcMasterGroup.alpha >= 0.99f)
            {
                m_iMenuState = EMainMenuState._IDLEIN_BUTTONS;
                m_goEventSystem.SetActive(true);
                m_gcESHandler.ForceNewButton(m_goMenuPrimaryButton);
            }
            break;



        case EMainMenuState._FADE_MASTER_OUT:
            m_gcMasterGroup.alpha -= Types.s_fDUR_MenuFadeSpeed * TimerManager.fGameDeltaTime;

            if (m_gcMasterGroup.alpha <= 0.01f)
            {
                OnHideInstant();
            }
            break;



        case EMainMenuState._FADE_BUTTONS_IN:
        {
            m_gcButtonsGroup.gameObject.SetActive(true);
            m_gcButtonsGroup.alpha        = 1f;
            m_gcButtonsGroup.interactable = true;
            m_gcSettingsGroup.gameObject.SetActive(false);
            m_gcSettingsGroup.alpha        = 0f;
            m_gcSettingsGroup.interactable = false;
            m_gcCreditsGroup.gameObject.SetActive(false);
            m_gcCreditsGroup.alpha        = 0f;
            m_gcCreditsGroup.interactable = false;
            m_gcESHandler.ForceNewButton(m_goMenuPrimaryButton);
            m_iMenuState = EMainMenuState._IDLEIN_BUTTONS;
        }
        break;



        case EMainMenuState._FADE_SETTINGS_IN:
        {
            m_gcButtonsGroup.gameObject.SetActive(false);
            m_gcButtonsGroup.alpha        = 0f;
            m_gcButtonsGroup.interactable = false;
            m_gcSettingsGroup.gameObject.SetActive(true);
            m_gcSettingsGroup.alpha        = 1f;
            m_gcSettingsGroup.interactable = true;
            m_gcCreditsGroup.gameObject.SetActive(false);
            m_gcCreditsGroup.alpha        = 0f;
            m_gcCreditsGroup.interactable = false;
            m_gcESHandler.ForceNewButton(m_goSettingsPrimaryButton);
            m_iMenuState = EMainMenuState._IDLEIN_SETTINGS;
        }
        break;


        case EMainMenuState._FADE_CREDITS_IN:
        {
            m_gcButtonsGroup.gameObject.SetActive(false);
            m_gcButtonsGroup.alpha        = 0f;
            m_gcButtonsGroup.interactable = false;
            m_gcSettingsGroup.gameObject.SetActive(false);
            m_gcSettingsGroup.alpha        = 0f;
            m_gcSettingsGroup.interactable = false;
            m_gcCreditsGroup.gameObject.SetActive(true);
            m_gcCreditsGroup.alpha        = 1f;
            m_gcCreditsGroup.interactable = true;
            m_gcESHandler.ForceNewButton(m_goSettingsPrimaryButton);
            m_iMenuState = EMainMenuState._IDLEIN_CREDITS;
        }
        break;

        case EMainMenuState._IDLEIN_BUTTONS:
        case EMainMenuState._IDLEIN_SETTINGS:
        case EMainMenuState._IDLEIN_CREDITS: break;
        }
    }
Beispiel #8
0
 public void ShowCredits()
 {
     m_iMenuState = EMainMenuState._FADE_CREDITS_IN;
 }
Beispiel #9
0
 public void ShowMainMenu()
 {
     m_iMenuState = EMainMenuState._FADE_BUTTONS_IN;
 }
        //------------------------------------------------------------
        void Update()
        {
            switch (StateId)
            {
                case EMainMenuState.Startup:
                    ARKLogger.LogMessage(eLogCategory.Control,
                                      eLogLevel.Info,
                                      "MainMenu: State: Startup.");

                    // Here we would do any menu preparation work.

                    // Has the logo been displayed already?
                    if (SceneLoader.Singleton.DisplayedLogo)
                        // Move to the next state.
                        StateId = EMainMenuState.Menu;
                    else
                    {
                        SceneLoader.Singleton.DisplayedLogo = true;
                        StateId = EMainMenuState.DisplayLogo;
                        LogoDisplayTimer = 1.0f;
                    }
                    break;

                case EMainMenuState.DisplayLogo:
                    LogoDisplayTimer -= Time.deltaTime;

                    if (LogoDisplayTimer < 0.0f)
                        StateId = EMainMenuState.Menu;
                    break;

                case EMainMenuState.Menu:
                    if (ButtonId == EMenuButtonId.StartGame)
                    {
                        ARKLogger.LogMessage(eLogCategory.Control,
                                             eLogLevel.Info,
                                             "MainMenu: Prototype Scene Selected.");
                        SceneLoader.Singleton.LoadLevelSync("ProtoB");
                    }
                    else if (ButtonId == EMenuButtonId.Quit)
                    {
                        ARKLogger.LogMessage(eLogCategory.Control,
                                             eLogLevel.Info,
                                             "MainMenu: Quit Selected.");
                        SceneLoader.Singleton.Quit();
                    }

                    ButtonId = EMenuButtonId.None;
                    break;

                default:
                    ARKLogger.LogMessage(eLogCategory.Control,
                                         eLogLevel.Error,
                                         "Really shouldn't be here... illegal state id set.");

                    // Auto recover.
                    StateId = EMainMenuState.Startup;
                    break;
            }
        }