Пример #1
0
        public NodeEditorPinView GetPinViewUnderMouse(Action <NodeEditorPinView> OnPinExists = null)
        {
            NodeEditorPinView outPinView = null;

            var nodeViews = _nodeViews.Values.ToList();

            nodeViews.ForEach(nodeView => nodeView.GetPinUnderMouse((pinView) =>
            {
                outPinView = pinView;
                OnPinExists.InvokeSafe(pinView);
            }));

            return(outPinView);
        }
Пример #2
0
        public NodeEditorPinView GetPinUnderMouse(Action <NodeEditorPinView> OnPinExists = null)
        {
            NodeEditorPinView pinUnderMouse = null;

            pinUnderMouse = _pinViews
                            .Values
                            .Where(x => x.ScreenRect.Contains(InputListener.MousePosition))
                            .FirstOrDefault();

            if (pinUnderMouse != null)
            {
                OnPinExists.InvokeSafe(pinUnderMouse);
            }

            return(pinUnderMouse != null ? pinUnderMouse : null);
        }
 public static Vector2 GetPinPosition(NodeEditorPinView pin)
 {
     return(pin.ScreenPosition + new Vector2(0f, pin.LocalRect.height * 0.5f));
 }
 public static void Draw(NodeEditorPinView startPin, Vector2 endPosition)
 {
     Draw(GetPinPosition(startPin), endPosition, NodeEditorColorHelper.GetPinColor(startPin.Pin.WrappedType));
 }
 public void EndDrawState()
 {
     _isDrawing = false;
     _startPin  = null;
 }
 public void EnterDrawState(NodePin startPin)
 {
     _isDrawing = true;
     Assert.IsTrue(_graphView.HasPinView(startPin));
     _startPin = _graphView.GetPinView(startPin);
 }
Пример #7
0
 public static void DrawConnection(NodeEditorPinView startPin, NodeEditorPinView endPin)
 {
     DrawConnection(GetPinPosition(startPin), GetPinPosition(endPin), NodeEditorColorHelper.GetPinColor(startPin.Pin.WrappedType));
 }