Beispiel #1
0
 void UpdatePortInputs()
 {
     foreach (var port in inputContainer.OfType <ShaderPort>())
     {
         if (!m_PortInputContainer.OfType <PortInputView>().Any(a => Equals(a.slot, port.slot)))
         {
             var portInputView = new PortInputView(port.slot)
             {
                 style = { positionType = PositionType.Absolute }
             };
             m_PortInputContainer.Add(portInputView);
             port.RegisterCallback <GeometryChangedEvent>(evt => UpdatePortInput((ShaderPort)evt.target));
         }
     }
 }
 void UpdateSlotAttachers()
 {
     foreach (var port in inputContainer.OfType <ShaderPort>())
     {
         if (!m_Attachers.Any(a => a.target == port))
         {
             var portInputView = new PortInputView(port.slot);
             Add(portInputView);
             mainContainer.BringToFront();
             m_Attachers.Add(new Attacher(portInputView, port, SpriteAlignment.LeftCenter)
             {
                 distance = -8f
             });
         }
     }
 }