Exemple #1
0
        public void SetPage(BaseMenuPage page)
        {
            if (page == null || m_activePage == page || page.WasDisabled)
            {
                return;
            }

            m_activePage?.Content?.SetActive(false);

            // unique case for console page, at the moment this will just go here
            if (m_activePage is CSharpConsole)
            {
                AutoCompleter.m_mainObj?.SetActive(false);
            }

            m_activePage = page;

            m_activePage.Content?.SetActive(true);

            Button button = page.RefNavbarButton;

            SetButtonActiveColors(button);

            if (m_lastNavButtonPressed && m_lastNavButtonPressed != button)
            {
                SetButtonInactiveColors(m_lastNavButtonPressed);
            }

            m_lastNavButtonPressed = button;

            OnActiveTabChanged?.Invoke(m_activePage.Type);
        }