private void Reset()
        {
            var park = GameController.Instance.park;

            if (park == null)
            {
                return;
            }

            for (var x = 0; x < park.xSize; x++)
            {
                for (var z = 0; z < park.zSize; z++)
                {
                    var patch = park.getTerrain(x, z);

                    // Remove water if present.
                    if (patch.hasWater())
                    {
                        WaterFlooding.unflood(new Vector3(x, 0, z));
                    }

                    // Reset height.
                    for (var i = 0; i < 4; i++)
                    {
                        var d = GroundHeight - patch.h[i];
                        if (d != 0)
                        {
                            patch.changeHeight(i, d);
                        }
                    }

                    // Reset terrain type.
                    patch.TerrainType = DefaultTerrainType;
                }
            }


            foreach (var o in FindObjectsOfType <TreeEntity>())
            {
                o.Kill();
            }
        }
Ejemplo n.º 2
0
        public void Reset()
        {
            if (park == null)
            {
                return;
            }

            for (var x = 0; x < park.xSize; x++)
            {
                for (var z = 0; z < park.zSize; z++)
                {
                    var patch = park.getTerrain(x, z);

                    // Remove water if present.
                    if (patch.hasWater())
                    {
                        WaterFlooding.unflood(new Vector3(x, 0, z));
                    }

                    // Reset height.
                    for (var i = 0; i < 4; i++)
                    {
                        var d = GROUND_HEIGHT - patch.h[i];
                        if (d != 0)
                        {
                            patch.changeHeight(i, d);
                        }
                    }

                    // Reset terrain type.
                    patch.TerrainType = DEFAULT_TERRAIN_TYPE;
                }
            }


            foreach (var o in ConfigWindow.FindObjectsOfType <TreeEntity>())
            {
                o.Kill();
            }
        }