Example #1
0
        protected virtual void DrawEdge()
        {
            if (!UpdateEdgeControl())
            {
                return;
            }

            if (selected)
            {
                if (isGhostEdge)
                {
                    Debug.Log("Selected Ghost Edge: this should never be");
                }

                edgeControl.inputColor  = selectedColor;
                edgeControl.outputColor = selectedColor;
                edgeControl.edgeWidth   = edgeWidth;

                if (m_InputPort != null)
                {
                    m_InputPort.capColor = selectedColor;
                }

                if (m_OutputPort != null)
                {
                    m_OutputPort.capColor = selectedColor;
                }
            }
            else
            {
                if (m_InputPort != null)
                {
                    m_InputPort.UpdateCapColor();
                }

                if (m_OutputPort != null)
                {
                    m_OutputPort.UpdateCapColor();
                }

                edgeControl.inputColor  = m_InputPort == null ? m_OutputPort.portColor : m_InputPort.portColor;
                edgeControl.outputColor = m_OutputPort == null ? m_InputPort.portColor : m_OutputPort.portColor;
                edgeControl.edgeWidth   = edgeWidth;

                edgeControl.toCapColor   = m_InputPort == null ? m_OutputPort.portColor : m_InputPort.portColor;
                edgeControl.fromCapColor = m_OutputPort == null ? m_InputPort.portColor : m_OutputPort.portColor;

                if (isGhostEdge)
                {
                    edgeControl.inputColor  = new Color(edgeControl.inputColor.r, edgeControl.inputColor.g, edgeControl.inputColor.b, 0.5f);
                    edgeControl.outputColor = new Color(edgeControl.outputColor.r, edgeControl.outputColor.g, edgeControl.outputColor.b, 0.5f);
                }
            }
        }
Example #2
0
        void UpdateEdgeControlColorsAndWidth()
        {
            if (selected)
            {
                if (isGhostEdge)
                {
                    Debug.Log("Selected Ghost Edge: this should never be");
                }

                edgeControl.inputColor  = selectedColor;
                edgeControl.outputColor = selectedColor;
                edgeControl.edgeWidth   = edgeWidth;

                if (m_InputPort != null)
                {
                    m_InputPort.capColor = selectedColor;
                }

                if (m_OutputPort != null)
                {
                    m_OutputPort.capColor = selectedColor;
                }
            }
            else
            {
                if (m_InputPort != null)
                {
                    m_InputPort.UpdateCapColor();
                }

                if (m_OutputPort != null)
                {
                    m_OutputPort.UpdateCapColor();
                }

                if (m_InputPort != null)
                {
                    edgeControl.inputColor = m_InputPort.portColor;
                }
                else if (m_OutputPort != null)
                {
                    edgeControl.inputColor = m_OutputPort.portColor;
                }

                if (m_OutputPort != null)
                {
                    edgeControl.outputColor = m_OutputPort.portColor;
                }
                else if (m_InputPort != null)
                {
                    edgeControl.outputColor = m_InputPort.portColor;
                }

                edgeControl.edgeWidth = edgeWidth;

                edgeControl.toCapColor   = edgeControl.inputColor;
                edgeControl.fromCapColor = edgeControl.outputColor;

                if (isGhostEdge)
                {
                    edgeControl.inputColor  = new Color(edgeControl.inputColor.r, edgeControl.inputColor.g, edgeControl.inputColor.b, 0.5f);
                    edgeControl.outputColor = new Color(edgeControl.outputColor.r, edgeControl.outputColor.g, edgeControl.outputColor.b, 0.5f);
                }
            }
        }