Beispiel #1
0
        public void InitializeGenerator()
        {
            // load seed if it's not loaded yet
            while (Engine.WorldSeed == 0)
            {
                Engine.GetSeed();
            }
            _seed = Engine.WorldSeed;

            _chunk = GetComponent <Chunk>();

            GenerateVoxelData();

            _chunk.empty = true;
            foreach (ushort voxel in _chunk.voxelData)
            {
                if (voxel != 0)
                {
                    _chunk.empty = false;
                    break;
                }
            }

            _chunk.voxelsDone = true;
        }
Beispiel #2
0
        public void InitializeGenerator()
        {
            // load seed if it's not loaded yet
            while (Engine.WorldSeed == 0)
            {
                Engine.GetSeed();
            }
            seed = Engine.WorldSeed;

            // get chunk component
            chunk = GetComponent <Chunk>();

            // generate data
            GenerateVoxelData();

            // set empty
            chunk.Empty = true;
            foreach (ushort voxel in chunk.VoxelData)
            {
                if (voxel != 0)
                {
                    chunk.Empty = false;
                    break;
                }
            }

            // flag as done
            chunk.VoxelsDone = true;
        }