Exemplo n.º 1
0
        public void AddNodeView(Node node)
        {
            bool containsNode = _nodeViews.ContainsKey(node);

            Assert.IsFalse(containsNode);

            if (!containsNode)
            {
                var nodeView = new NodeEditorNodeView(node, _nodeViews.Count);
                _nodeViews.Add(node, nodeView);
            }
        }
Exemplo n.º 2
0
        public NodeEditorNodeView GetNodeViewUnderMouse(Action <NodeEditorNodeView> callback = null)
        {
            NodeEditorNodeView nodeView = null;

            nodeView = _nodeViews
                       .Values
                       .Where(x => x.Rect.Contains(InputListener.MousePosition))
                       .FirstOrDefault();

            callback.InvokeSafe(nodeView);

            return(nodeView);
        }