Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using System.Collections;
- public class Chunk
- {
- //Parameters
- private Block[,,] Blocks;
- private static int chunkSize = 16;
- //Constructors
- public Chunk() //make empty chunk
- {
- for (int x = 0; x < chunkSize; x ++) //for each row
- {
- for (int y = 0; y < chunkSize; y ++) //for each vertical column
- {
- for (int z = 0; z < chunkSize; z ++) //for each horizontal column
- {
- Blocks[x, y, z] = new BlockAir();
- }
- }
- }
- }
- public Chunk(Block[,,] Blocks) //make predefined chunk with block array as argument
- {
- this.Blocks = Blocks;
- }
- public void getBlock(int x, int y, int z)
- {
- return Blocks[x, y, z];
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment