Komak57

GridExpand

Mar 29th, 2014
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.48 KB | None | 0 0
  1.         Debug.Log ("Generating a "+Mathf.RoundToInt((RenderDist*2)/width)*width+"x"+Mathf.RoundToInt((RenderDist*2)/height)*height);
  2.         Grid = new RollingGrid<Chunk> (Mathf.RoundToInt((RenderDist*2)/width)*width, Mathf.RoundToInt((RenderDist*2)/height)*height);
  3.         for(int y = 0; y < Grid.Height(); y++) {
  4.             for(int x = 0; x < Grid.Width(); x++) {
  5.                 int ID = (y*width)+Mathf.RoundToInt(x/width);
  6.                 //Debug.Log("Grid["+x+","+y+"]: Set to ID "+ID);
  7.                 Grid[x,y] = new Chunk(ID);
  8.             }
  9.         }
Advertisement
Add Comment
Please, Sign In to add comment