Esempio n. 1
0
    public void PushMenuState(MenuState.State newState)
    {
        Debug.Log("Push State: " + newState);

        MenuState menuState = null;

        foreach (MenuState m in m_menuStates)
        {
            if (m.state == newState)
            {
                menuState = m;
                break;
            }
        }

        if (m_menuState != null)
        {
            m_menuState.OnHold();
        }

        m_menuState = menuState;

        if (m_menuState != null)
        {
            m_menuStateStack.Add(m_menuState);
            m_menuState.OnActivate();
        }
    }