Example #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);
        }
Example #2
0
        public PWGraphBuilder Execute(bool clearCommandsOnceExecuted = false)
        {
            foreach (var cmd in commands)
            {
                graph.Execute(cmd);
            }

            if (clearCommandsOnceExecuted)
            {
                commands.Clear();
            }

            graph.UpdateComputeOrder();

            return(this);
        }
Example #3
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());
            }
        }