public float Process(BaseGraph graph) { float calculTime = 0f; bool realMode = graph.IsRealMode(); currentGraph = graph; hasProcessed = false; if (graph.GetComputeSortedNodes() == null) { graph.UpdateComputeOrder(); } try { foreach (var node in graph.GetComputeSortedNodes()) { //ignore unlinked nodes if (node.computeOrder < 0) { continue; } calculTime += ProcessNode(node, realMode); } } catch (Exception e) { Debug.LogError(e); return(calculTime); } hasProcessed = true; return(calculTime); }
public GraphBuilder Execute(bool clearCommandsOnceExecuted = false) { SortCommands(); foreach (var cmd in commands) { graph.Execute(cmd); } if (clearCommandsOnceExecuted) { commands.Clear(); } graph.UpdateComputeOrder(); postExecuteCallbacks.ForEach(c => c(graph)); return(this); }
public void ProcessOnce(BaseGraph graph) { if (graph.GetComputeSortedNodes() == null) { graph.UpdateComputeOrder(); } currentGraph = graph; foreach (var node in graph.GetComputeSortedNodes()) { //ignore unlinked nodes if (node.computeOrder < 0) { continue; } node.OnNodeProcessOnce(); ProcessNodeLinks(node, graph.IsRealMode()); } }