示例#1
0
        public NENode(Vector2 position, float width, float height, GUIStyle nodeStyle, GUIStyle selectedStyle, GUIStyle inPointStyle, GUIStyle outPointStyle, Action <NEConnectionPoint> OnClickInPoint, Action <NEConnectionPoint> OnClickOutPoint, Action <NENode> OnClickRemoveNode)
        {
            rect     = new Rect(position.x, position.y, width, height);
            style    = nodeStyle;
            inPoint  = new NEConnectionPoint(this, ConnectionPointType.In, inPointStyle, OnClickInPoint);
            outPoint = new NEConnectionPoint(this, ConnectionPointType.Out, outPointStyle, OnClickOutPoint);

            defaultNodeStyle  = nodeStyle;
            selectedNodeStyle = selectedStyle;

            OnRemoveNode = OnClickRemoveNode;
        }
示例#2
0
        private void OnClickOutPoint(NEConnectionPoint outPoint)
        {
            selectedOutPoint = outPoint;

            if (selectedInPoint != null)
            {
                if (selectedOutPoint.node != selectedInPoint.node)
                {
                    CreateConnection();
                    ClearConnectionSelection();
                }
                else
                {
                    ClearConnectionSelection();
                }
            }
        }
示例#3
0
 public NEConnection(NEConnectionPoint inPoint, NEConnectionPoint outPoint, Action <NEConnection> OnClickRemoveConnection)
 {
     this.inPoint  = inPoint;
     this.outPoint = outPoint;
     this.OnClickRemoveConnection = OnClickRemoveConnection;
 }
示例#4
0
 private void ClearConnectionSelection()
 {
     selectedInPoint  = null;
     selectedOutPoint = null;
 }