protected override void DrawSlot(Slot slot)
        {
            base.DrawSlot(slot);

            if (Event.current.type == EventType.MouseDown &&
                Event.current.button == 0)
            {
                var rect = GetDrawSlotRect(slot);
                if (rect.Contains(Event.current.mousePosition))
                {
                    // TODO pass actual slot
                    Presenter.OnNodeConnectorClicked(slot, rect.center);
                }
            }
        }
Beispiel #2
0
        void DrawChildConnector(Rect dotRect)
        {
            ChildDotRect.Set(
                dotRect.xMax - ConnectorSize.x * 0.5f,
                dotRect.center.y - ConnectorSize.y * 0.5f,
                ConnectorSize.x,
                ConnectorSize.y
                );

            GUI.Box
            (
                ChildDotRect,
                GUIContent.none, SpaceEditorStyles.DotFlowTarget
            );

            if (ActionNode.Connections.Any())
            {
                GUI.color = Selected ? SpaceEditorStyles.ActiveColor : Color.white;
                GUI.Box
                (
                    ChildDotRect,
                    GUIContent.none, SpaceEditorStyles.DotFlowTargetFill
                );
            }

            if (ChildDotRect.Contains(Event.current.mousePosition) &&
                Event.current.type == EventType.MouseDown &&
                Event.current.button == 0)
            {
                Presenter.OnNodeConnectorClicked(this, ChildDotRect.center);
            }

            GUI.color = Color.white;
        }