Example #1
0
        public void InitGraph(PWMainGraph graph)
        {
            if (graph != null)
            {
                this.graph = graph;
            }
            else
            {
                return;
            }

            graph.SetRealMode(true);
            chunkSize   = graph.chunkSize;
            graphOutput = graph.outputNode as PWNodeGraphOutput;
            graph.UpdateComputeOrder();
            if (!graph.IsRealMode())
            {
                terrainRoot = GameObject.Find("PWPreviewTerrain");
            }
            if (terrainRoot == null)
            {
                terrainRoot = GameObject.Find(PWConstants.realModeRootObjectName);
                if (terrainRoot == null)
                {
                    terrainRoot = new GameObject(PWConstants.realModeRootObjectName);
                    terrainRoot.transform.position = Vector3.zero;
                }
            }
            graph.ProcessOnce();
        }