Beispiel #1
0
        private void Update()
        {
            //Update the sky, sun and controller. These node are presumed to always be present
            Controller.UpdateController();
            SunNode.UpdateNode();
            SkyNode.UpdateNode();

            //Uppdate ocean if used
            if (OceanNode != null)
            {
                OceanNode.UpdateNode();
            }

            //Update all the terrain nodes used and active
            foreach (TerrainNode node in m_terrainNodes)
            {
                if (node.gameObject.activeInHierarchy)
                {
                    node.UpdateNode();
                }
            }

            //Update all the samplers used and active
            foreach (TileSampler sampler in m_samplers)
            {
                if (sampler.gameObject.activeInHierarchy)
                {
                    sampler.UpdateSampler();
                }
            }

            //Draw the terrain quads of each terrain node if active
            foreach (TerrainNode node in m_terrainNodes)
            {
                if (node.gameObject.activeInHierarchy)
                {
                    DrawTerrain(node);
                }
            }
        }