Exemple #1
0
 public void SetSectionControl(ISectionControl section)
 {
     if (section == null)
     {
         return;
     }
     m_Section            = section;
     m_DisplayToggle.isOn = m_Section.IsVisible;
     m_DisplayText.text   = m_Section.Name;
 }
        private void CreateMenuSection(ISectionControl section)
        {
            GameObject menuSectionObject = Instantiate(m_MenuSectionPrefab);

            if (menuSectionObject != null)
            {
                menuSectionObject.transform.SetParent(m_SectionsTransform, false);
                ToolbarMenuSection menuSection = menuSectionObject.GetComponent <ToolbarMenuSection>();
                if (menuSection != null)
                {
                    menuSection.SetControl(section);
                }
            }
        }
 private void CreateMenuSections(System.Collections.Generic.IList <ISectionControl> sections)
 {
     if (sections == null || m_MenuSectionPrefab == null || m_SectionsTransform == null)
     {
         return;
     }
     for (int i = 0; i < sections.Count; i++)
     {
         ISectionControl section = sections[i];
         if (section != null)
         {
             CreateMenuSection(section);
         }
     }
 }
Exemple #4
0
 public void OnDestroy()
 {
     m_Control = null;
 }
Exemple #5
0
 public void SetControl(ISectionControl control)
 {
     m_Control            = control;
     m_DisplayToggle.isOn = m_Control.IsVisible;
     m_DisplayText.text   = m_Control.Name;
 }
Exemple #6
0
 public void OnDestroy()
 {
     m_Section = null;
 }