Ramaraunt1

Untitled

Dec 27th, 2016
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. using UnityEngine;
  2. using System.Collections;
  3.  
  4. public class Chunk
  5. {
  6. //Parameters
  7. private Block[,,] Blocks;
  8. private static int chunkSize = 16;
  9.  
  10. //Constructors
  11. public Chunk() //make empty chunk
  12. {
  13. for (int x = 0; x < chunkSize; x ++) //for each row
  14. {
  15. for (int y = 0; y < chunkSize; y ++) //for each vertical column
  16. {
  17. for (int z = 0; z < chunkSize; z ++) //for each horizontal column
  18. {
  19. Blocks[x, y, z] = new BlockAir();
  20. }
  21. }
  22. }
  23. }
  24.  
  25. public Chunk(Block[,,] Blocks) //make predefined chunk with block array as argument
  26. {
  27. this.Blocks = Blocks;
  28. }
  29.  
  30. public void getBlock(int x, int y, int z)
  31. {
  32. return Blocks[x, y, z];
  33. }
  34.  
  35.  
  36. }
Advertisement
Add Comment
Please, Sign In to add comment