Ejemplo n.º 1
0
        private void Awake()
        {
            Settings = new TerrainChunkSettings(129, 129, 100, 40, FlatTexture, SteepTexture, TerrainMaterial);
            NoiseProvider = new NoiseProvider();

            Cache = new ChunkCache();
        }
        private void Awake()
        {
            Settings      = new TerrainChunkSettings(129, 129, 100, 40, FlatTexture, SteepTexture, TerrainMaterial);
            NoiseProvider = new NoiseProvider();

            Cache = new ChunkCache();
        }
Ejemplo n.º 3
0
        public TerrainChunk(TerrainChunkSettings settings, NoiseProvider noiseProvider, int x, int z)
        {
            HeightmapThreadLockObject = new object();

            Settings      = settings;
            NoiseProvider = noiseProvider;

            Position = new Vector2i(x, z);
        }
Ejemplo n.º 4
0
        public TerrainChunk(TerrainChunkSettings settings, NoiseProvider noiseProvider, int x, int z)
        {
            HeightmapThreadLockObject = new object();

            Settings = settings;
            NoiseProvider = noiseProvider;
            Neighborhood = new TerrainChunkNeighborhood();

            Position = new Vector2i(x, z);
        }
//        private TerrainChunkNeighborhood Neighborhood { get; set; }
//
//        private float[,] Heightmap { get; set; }
//
//        private object HeightmapThreadLockObject { get; set; }
//

        public TerrainChunk(Transform parent, TerrainChunkSettings settings, NoiseProvider noiseProvider, int x, int z)
        {
            //HeightmapThreadLockObject = new object();

            Settings      = settings;
            NoiseProvider = noiseProvider;
            //Neighborhood = new TerrainChunkNeighborhood();

            X    = x;
            Z    = z;
            Parr = parent;
        }
Ejemplo n.º 6
0
        public TerrainChunk(TerrainChunkSettings settings, WorldGenerator worldGenerator, ChunkEdge edgetype, int x, int z)
        {
            HeightmapThreadLockObject = new object();
            WorldGenerator            = worldGenerator;
            Settings = settings;
            EdgeType = edgetype;

            Biomes       = new List <BiomeType>();
            Neighborhood = new TerrainChunkNeighborhood();

            Position = new Vector2i(x, z);
        }
Ejemplo n.º 7
0
        private void Awake()
        {
            Settings      = new TerrainChunkSettings(129, 129, 100, 30, FlatTexture, SteepTexture, TerrainMaterial);
            NoiseProvider = new NoiseProvider();

            addChunk(0, 0);
            addChunk(0, 1);
            addChunk(0, 2);
            addChunk(0, 3);
            addChunk(0, 4);
            addChunk(0, 5);
            addChunk(0, 6);
        }
Ejemplo n.º 8
0
        private void Awake()
        {
            WorldGenerator = new WorldGenerator();
            WorldGenerator.GenerateWorldMap();

            var BiomeWorldmap = WorldGenerator.ElevationData;

            Settings = new TerrainChunkSettings(129, 129, 129, 40, FlatTexture, SteepTexture, SandTexture, TerrainMaterial);
            // Debug.Log("Settings Created");
            NoiseProvider = new NoiseProvider();

            Cache = gameObject.AddComponent <ChunkCache>();

            //Debug.Log("Cache Created");
        }
        void Test()
        {
            var settings      = new TerrainChunkSettings(129, 129, 100, 20);
            var noiseProvider = new NoiseProvider();

            //part1
            //var terrain = new TerrainChunk(this.transform,settings, noiseProvider, 0, 0);
            //terrain.CreateTerrain();

            //part2
            for (var i = 0; i < 4; i++)
            {
                for (var j = 0; j < 4; j++)
                {
                    new TerrainChunk(this.transform, settings, noiseProvider, i, j).CreateTerrain();
                }
            }
        }