Example #1
0
    public void PopulateMenu()
    {
        m_ListItems = new UIMenuItem[m_MenuLabels.Length];
        for (int i = 0; i < m_MenuLabels.Length; i++)
        {
            GameObject itemObj = (GameObject)Instantiate(m_MenuItemPrefab, m_MenuContainer);
            UIMenuItem item    = itemObj.GetComponent <UIMenuItem>();
            if (item != null)
            {
                item.DefaultItem(m_DefaultFrameColor, m_DefaultTextColor, m_HighlightFrameColor, m_HighlightTextColor);
                item.SetLabel(m_MenuLabels[i]);

                m_ListItems[i] = item;
            }
        }

        SetActiveItem(m_ListItems[m_ActiveIndex]);
    }