Exemplo n.º 1
0
 public void GenerateWorldDataMaps()
 {
     Task.Run(() => {
         var worldDataMaps = WorldDataMaps.CreateAndGenerate(X, Z);
         lock (lockObject)
         {
             this.DataMaps = worldDataMaps;
         }
     });
 }
Exemplo n.º 2
0
        public static WorldDataMaps CreateAndGenerate(int cX, int cZ)
        {
            var worldDataMaps = new WorldDataMaps();

            worldDataMaps.HeightMap.ForEachPoint(cX, cZ, (x, z) => G.NoiseMaker.GetElevationNoise(x, z));
            worldDataMaps.TemperatureMap.ForEachPoint(cX, cZ, (x, z) => G.NoiseMaker.GetTemperatureNoise(x, z));
            worldDataMaps.MoistureMap.ForEachPoint(cX, cZ, (x, z) => G.NoiseMaker.GetMoistureNoise(x, z));
            worldDataMaps.BiomeMap.ForEachPoint(cX, cZ, (x, z) => G.NoiseMaker.GetBiomeNoise(x, z));

            return(worldDataMaps);
        }
Exemplo n.º 3
0
        public void Remove()
        {
            lock (lockObject)
            {
                this.DataMaps = null;
            }

            foreach (var neighbor in Neighbors)
            {
                neighbor.Neighbors.Remove(this);
            }
            Neighbors.Clear();

            if (content.Terrain != null)
            {
                GameObject.Destroy(content.Terrain.gameObject);
            }
        }