Example #1
0
    /// <summary>
    /// Tether Button click for tether buttons in pop up menu
    /// </summary>
    /// <param name="stateToLoad">LevelStateManager state to load, starting at 0.</param>
    public void OnTetherMenuButtonClick(int stateToLoad)
    {
        if (tetherUIState != TetherUIState.TETHER_MENU)
        {
            Debug.LogError("Shouldn't be able to click menu tether button when not in TetherUIState.TETHER_MENU. Currently in TetherUIState." + tetherUIState);
            return;
        }
        AudioLibrary.PlayTetherSelect();
        tetherUIState = TetherUIState.TETHER_ANIMATION;
        //GameManager.setPause(true);
        GameManager.inst.ExitPauseState();
        GameManager.inst.EnterPauseState(PauseType.TETHER_TRANSITION);
        CursorManager.inst.lockCursorType = true;
        CursorManager.inst.cursorState    = CursorState.DEACTIVATED;

        // Start the animation coroutine that begins with the hide menu code
        StartCoroutine("TetherBackAnimation_HideMenu", stateToLoad);
    }