예제 #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;
 }