private void Update() { if (EdgeTriggersTracker.HasData()) { Repaint(); } }
public void PopulateEdges() { foreach (var outSlot in outputSlots) { List <SmartGraphConnection> outCalls = _runtimeInstance.Outputs.FindAll(call => call.EventName == outSlot.name); foreach (SmartGraphConnection call in outCalls) { var targetNode = graph[call.Receiver.GetInstanceID().ToString()]; var inSlot = targetNode[call.MethodFullPath]; if (!graph.Connected(outSlot, inSlot)) { Edge edge = graph.Connect(outSlot, inSlot); EdgeGUI.EdgesData.Add(edge, call); call.OnTriggered += ((direction) => { EdgeTriggersTracker.RegisterTrigger(edge, direction); if (direction) { foreach (var otherEdges in inSlot.node.inputEdges) { if (otherEdges != edge) { EdgeTriggersTracker.RegisterTrigger(otherEdges, !direction); } } } }); } } } }
static void DrawEdge(Edge edge, Vector2Int indexes, Color color, float thicknessFactor, bool dashed) { var p1 = GetPositionAsFromSlot(edge.fromSlot, indexes.x); var p2 = GetPositionAsToSlot(edge.toSlot, indexes.y); DrawEdge(p1, p2, color * edge.color, thicknessFactor, EdgeTriggersTracker.GetTimings(edge), dashed); }