protected void CreateGraph() { if (Graph != null) { Graph.Dispose(); } Graph = TinyGraph.Create(); Graph.OnCreateNode += OnCreateNode; Graph.OnCreateEdge += OnCreateEdge; Graph.OnCopyNode += OnCopyNode; Graph.OnCopyEdge += OnCopyEdge; }
public static TinyNode GetNodeUnder(this TinyGraph graph, Vector2 point, TinySelector selector = null) { var nodes = graph.Nodes.Where(x => TinyGUI.GetNodeRect(x.Position).Contains(point)); return(selector == null?nodes.FirstOrDefault() : nodes.OrderByDescending(selector.IsSelected).FirstOrDefault()); }
public void Process(TinyGraph graph) { _graph = graph; Process(Event.current); }
public void OnUpdate(TinyGraph graph) => _graph = graph;