예제 #1
0
        //methods
        public JNode(Rect r, GUIContent c, GUIStyle s, ChuTools.IEventSystem eventSystem, System.Action <JNode> onNodeDelete) : this(r, c, s)
        {
            EventSystem                 = eventSystem;
            EventSystem.OnMouseDown    += OnMouseDown;
            _onNodeDelete               = onNodeDelete;
            EventSystem.OnContextClick += onContextClick;
            EventSystem.OnMouseDrag    += OnMouseDrag;

            outPoint = new ConnectionPoint(OutRect, "out");
            inPoint  = new ConnectionPoint(InRect, "in");
        }
예제 #2
0
 // methods
 void OnEnable()
 {
     startRect                   = new Rect(Vector2.zero, Vector2.zero);
     endRect                     = new Rect(Vector2.zero, Vector2.zero);
     wantsMouseMove              = true;
     nodes                       = new List <JNode>();
     connections                 = new List <Connection>();
     EventSystem                 = new ChuTools.NodeWindowEventSystem();
     EventSystem.OnMouseDown    += OnMouseDown;
     EventSystem.OnMouseUp      += OnMouseUp;
     EventSystem.OnMouseDrag    += OnMouseDrag;
     EventSystem.OnContextClick += onContextClick;
 }