private void AddSubGroup(IVesselSubGroup subGroup, bool last)
        {
            if (subGroup == null)
            {
                return;
            }

            VesselSubGroup obj = Instantiate(m_SubGroupPrefab);

            obj.transform.SetParent(m_SubGroupTransform, false);
            obj.Initialize(subGroup, this, last);
        }
Exemple #2
0
        public void Initialize(ISubHeaderItem header, VesselSubGroup group, VesselGroup grand, bool last, bool startOn)
        {
            if (header == null || group == null)
            {
                return;
            }

            _parent      = group;
            _grandParent = grand;

            _headerInterface = header;

            if (m_NameText != null)
            {
                m_NameText.OnTextUpdate.Invoke(header.HeaderName);
            }

            if (m_InfoText != null)
            {
                m_InfoText.OnTextUpdate.Invoke(header.HeaderInfo);
            }

            if (m_ConnectorIcon != null)
            {
                m_ConnectorIcon.sprite = last ? m_EndConnector : m_DoubleConnector;
            }

            AssignHeaderObject(header.HeaderImage);

            if (m_HeaderToggle != null)
            {
                m_HeaderToggle.isOn = startOn;
            }

            _loaded = true;
        }