Esempio n. 1
0
        void SetupReplicatorRow()
        {
            UpdateReplicator();

            m_NodeContainer.Bind(m_ReplicatorSerializedObject);

            UpdateCountOption();
            UpdateProxyField();

            if (!IsGroup)
            {
                foreach (Transform child in m_Entity.transform)
                {
                    if (!ContentRow.IsApplicableToTransform(child))
                    {
                        continue;
                    }

                    var contentRow = new ContentRow(BackingReplicator.transform, child);
                    m_ContentContainer.Add(contentRow);
                }
            }

            var simObject = SimulatedObjectsManager.instance.GetCopiedTransform(BackingReplicator.transform);

            if (simObject == null)
            {
                m_SimMatchCount.style.display = DisplayStyle.None;
                return;
            }

            SimulatedReplicator = simObject.GetComponent <Replicator>();

            UpdateSimMatchCount();
        }
        protected sealed override void SetupUI()
        {
            var proxyRowAsset = AssetDatabase.LoadAssetAtPath <VisualTreeAsset>(k_ProxyRowPath);

            proxyRowAsset.CloneTree(this);

            base.SetupUI();

            SetupProxyPresetUI(m_Entity);
            m_ProxyField.value = m_Entity;

            m_SimMatchCount = this.Q <Label>(k_SimMatchCountName);
            if (m_SimulatedObject == null)
            {
                m_SimMatchCount.style.display = DisplayStyle.None;
            }

            m_ContentContainer = this.Q <VisualElement>(k_ContentContainerName);

            foreach (Transform child in m_Transform)
            {
                if (!ContentRow.IsApplicableToTransform(child))
                {
                    continue;
                }
                var contentRow = new ContentRow(m_Transform, child);
                m_ContentContainer.Add(contentRow);
            }

            CreateAddContentButton();
        }