Linq syntactic sugar

Since we’re not in game logic, it’s a nice chance to use delicious Linq sugar like this to determine the node we’re currently pointing at:

var selectedNode = _selected.GetAllNodes().LastOrDefault(n => n.Rect.Contains(Event.current.mousePosition));

Also for dragging, there is the simpler:
_draggingNode.Rect.position += Event.current.delta;

1 Like

Nice :+1:

Privacy & Terms