Пример #1
0
        public void Init()
        {
            while (MapGenerator.Seed == 0)
            {
                MapGenerator.GenWorldSeed();
            }
            seed = MapGenerator.Seed;

            chunk = GetComponent <Chunk>();

            GenerateBlockData();
            chunk.isEmpty = true;
            foreach (var block in chunk.BlockData)
            {
                if (block != 0)
                {
                    chunk.isEmpty = false;
                    break;
                }
            }

            chunk.BlockDown = true;
        }
Пример #2
0
 public BaseBlock GetBlockType()
 {
     return(MapGenerator.GetBlockType(chunk.GetBlock(index)));
 }
Пример #3
0
 public BaseBlock GetNearbyBlockType()
 {
     return(MapGenerator.GetBlockType(chunk.GetBlock(nearbyIndex)));
 }
Пример #4
0
        public static void SpawnChunks(Vector3 pos)
        {
            Index index = MapGenerator.PositionToChunkIndex(pos);

            MapGenerator.ChunkManagerInstance.TrySpawnChunks(index);
        }