public static void CreateChunks(ChunkObject terrain, Transform parent, bool visible)
        {
            if (WorldMesh.chunkMeshMap == null)
            {
                return;
            }

            WorldMesh.ConfirmChanges(false);
            ClearChunkMap();

            chunkMap = new Chunk[chunkXCount, chunkYCount];
            for (int x = 0; x < chunkXCount; x++)
            {
                for (int y = 0; y < chunkYCount; y++)
                {
                    chunkMap[x, y] = new Chunk(terrain, parent, visible, WorldMesh.chunkMeshMap[x, y]);
                }
            }
        }
Example #2
0
        public Vector3 this[int x, int y]
        {
            get
            {
                if (IsValid(x, y))
                {
                    return(map[x, y]);
                }

                return(Vector3.zero);
            }
            set
            {
                if (IsValid(x, y))
                {
                    map[x, y] = value;
                    WorldMesh.SetEditedPosition(x, y);
                    WorldMesh.UpdateHeight(value.y);
                }
            }
        }