/// <inheritdoc />
        protected override void BuildPartUI(VisualElement container)
        {
            if (m_Model is IPortNodeModel)
            {
                m_Root = new VisualElement {
                    name = PartName
                };
                m_Root.AddToClassList(ussClassName);
                m_Root.AddToClassList(m_ParentClassName.WithUssElement(PartName));

                m_InputPortContainer = new PortContainer {
                    name = inputPortsUssName
                };
                m_InputPortContainer.AddToClassList(m_ParentClassName.WithUssElement(inputPortsUssName));
                m_Root.Add(m_InputPortContainer);

                m_OutputPortContainer = new PortContainer {
                    name = outputPortsUssName
                };
                m_OutputPortContainer.AddToClassList(m_ParentClassName.WithUssElement(outputPortsUssName));
                m_Root.Add(m_OutputPortContainer);

                container.Add(m_Root);
            }
        }
コード例 #2
0
 /// <inheritdoc />
 protected override void BuildPartUI(VisualElement container)
 {
     if (m_Model is IPortModel)
     {
         m_PortContainer = new PortContainer {
             name = PartName
         };
         m_PortContainer.AddToClassList(m_ParentClassName.WithUssElement(PartName));
         container.Add(m_PortContainer);
     }
 }
        /// <inheritdoc />
        protected override void BuildPartUI(VisualElement container)
        {
            if (m_Model is IPortNodeModel portHolder)
            {
                m_Root = new VisualElement {
                    name = PartName
                };
                m_Root.AddToClassList(ussClassName);
                m_Root.AddToClassList(m_ParentClassName.WithUssElement(PartName));

                PortContainer = new PortContainer {
                    name = portsUssName
                };
                PortContainer.AddToClassList(m_ParentClassName.WithUssElement(portsUssName));
                m_Root.Add(PortContainer);

                var ports = portHolder.Ports.Where(p => p.Orientation == PortOrientation.Horizontal);
                PortContainer?.UpdatePorts(ports, m_OwnerElement.View, m_OwnerElement.CommandDispatcher);

                container.Add(m_Root);
            }
        }
コード例 #4
0
        /// <inheritdoc />
        protected override void BuildPartUI(VisualElement container)
        {
            if (m_Model is IInputOutputPortsNodeModel portNode)
            {
                m_Root = new VisualElement {
                    name = PartName
                };
                m_Root.AddToClassList(ussClassName);
                m_Root.AddToClassList(m_ParentClassName.WithUssElement(PartName));

                m_PortContainer = new PortContainer {
                    name = portsUssName
                };
                m_PortContainer.AddToClassList(m_ParentClassName.WithUssElement(portsUssName));
                m_Root.Add(m_PortContainer);

                var ports = (m_PortDirection == PortDirection.Input ? portNode.GetInputPorts() : portNode.GetOutputPorts())
                            .Where(p => p.Orientation == PortOrientation.Vertical);

                m_PortContainer?.UpdatePorts(ports, m_OwnerElement.View, m_OwnerElement.CommandDispatcher);

                container.Add(m_Root);
            }
        }