Пример #1
0
    public void Init(MENU_TYPE menuType)
    {
        Debug.Log("Initializing logo");

        // build the prefabs
        BuildAndSetupMainLogo(menuType);

        // set current state to open
        m_currState = MENU_STATE.JUST_LOGO;
    }
    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    ///                                             PUBLIC FUNCTIONS											     ///
    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    /// <summary>
    /// Called to show a given menu. Handles pausing the game and setting correct flags
    /// </summary>
    /// <param name="menu">The menu object to show</param>
    public void showMenu(MENU_TYPE menuType)
    {
        bool pauseTime = true;

        hideMenu();

        switch (menuType)
        {
        case MENU_TYPE.Pause:
            SpecialEffectsManager.Instance.playSound(showSound);
            _activeMenu = pauseMenu;
            break;

        case MENU_TYPE.Controls:
            _activeMenu = controlsMenu;
            break;

        case MENU_TYPE.GameOver:
            pauseTime   = false;
            _activeMenu = gameOverMenu;
            break;

        case MENU_TYPE.LevelComplete:
            _activeMenu = levelCompleteMenu;
            break;

        case MENU_TYPE.LevelSelect:
            _activeMenu = levelSelectMenu;
            break;

        case MENU_TYPE.MedicalShop:
            _activeMenu = medicalShopMenu;
            break;

        case MENU_TYPE.Armory:
            _activeMenu = armoryShopMenu;
            break;

        case MENU_TYPE.Tech_1:
            _activeMenu = techShopMenu1;
            break;

        case MENU_TYPE.Tech_2:
            _activeMenu = techShopMenu2;
            break;
        }

        // If time is suposed to pause then pause it
        if (pauseTime)
        {
            pause();
        }

        _activeMenu.SetActive(true);
    }
Пример #3
0
    private void BuildAndSetupMainLogo(MENU_TYPE menuType) // TODO: don't need the type here... just prefab whatever's attached to the script
    {
        if (menuType == MENU_TYPE.Liiv)
        {
            m_centralLogoObj = Instantiate(menuLogoLiivPrefab, transform.position, transform.rotation) as GameObject;
        }
        else // TODO: other menu types will be instantiated here
        {
            m_centralLogoObj = Instantiate(menuLogoLiivPrefab, transform.position, transform.rotation) as GameObject;
        }

        m_centralLogoObj.transform.position = new Vector3(m_centralLogoObj.transform.position.x, m_centralLogoObj.transform.position.y, m_centralLogoObj.transform.position.z + 0.035f);
        m_centralLogoObj.transform.SetParent(transform, true);


        // get ref to logo's script
        m_logoAnimateable = m_centralLogoObj.transform.GetComponent <LogoAnimateable>();
        Debug.Log("Got logo strip " + (m_logoAnimateable != null ? "true" : "false"));
        // Start the logo animation
        m_logoAnimateable.SetAnimationState(LogoAnimateable.ANIM_STATE.ANIM_IN);
    }