/// <summary> /// Sets the assigned section to be handled by the menu object. /// </summary> public void SetAssignedSection(ISectionModule section) { if (section == null) { return; } this.section = section; }
/// <summary> /// Sets the assigned section to be handled by the menu object. /// </summary> public void SetAssignedSection(ISectionModule section) { if (section == null) { return; } m_Section = section; }
/// <summary> /// Creates a list of section controls from a given list of sections. /// </summary> private void CreateSectionControls(IList <ISectionModule> sections) { if (sections == null || menuSectionPrefab == null || sectionsTransform == null) { return; } for (int i = 0; i < sections.Count; i++) { ISectionModule section = sections[i]; if (section != null) { CreateSectionControl(section); } } }
/// <summary> /// Creates a menu section control. /// </summary> private void CreateSectionControl(ISectionModule section) { GameObject menuSectionObject = Instantiate(menuSectionPrefab); if (menuSectionObject != null) { // apply ksp theme to the created menu section object flightAppLauncher.ApplyTheme(menuSectionObject); menuSectionObject.transform.SetParent(sectionsTransform, false); FlightMenuSection menuSection = menuSectionObject.GetComponent <FlightMenuSection>(); if (menuSection != null) { menuSection.SetAssignedSection(section); } } }
/// <summary> /// Creates a menu section control. /// </summary> private void CreateSectionControl(ISectionModule section) { GameObject menuSectionObject = Instantiate(m_MenuSectionPrefab); if (menuSectionObject != null) { // apply ksp theme to the created menu section object m_FlightAppLauncher.ApplyTheme(menuSectionObject); menuSectionObject.transform.SetParent(m_SectionsTransform, false); FlightMenuSection menuSection = menuSectionObject.GetComponent<FlightMenuSection>(); if (menuSection != null) { menuSection.SetAssignedSection(section); } } }