Exemple #1
0
        public float Process(PWGraph 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);
                Debug.Log("Stopping graph processing due to an unexpected error");
                return(calculTime);
            }

            hasProcessed = true;

            return(calculTime);
        }
Exemple #2
0
        public void     ProcessOnce(PWGraph 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());
            }
        }