Advertisement
Guest User

BydloGeneratorMap

a guest
Jul 25th, 2016
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.93 KB | None | 0 0
  1. public class GenerateMap : MonoBehaviour
  2. {
  3.     public GameObject[] Blocks;
  4.     void Start()
  5.     {
  6.         for (int i = 0; i < 20; i++)
  7.         {
  8.             for (int j = 0; j < 20; j++)
  9.             {
  10.                 float Zed = Blocks[0].transform.position.z + j;
  11.                 Instantiate(Blocks[0], new Vector3(Blocks[0].transform.position.x + i, Blocks[0].transform.position.y, Zed), new Quaternion(0, 0, 0, 0));
  12.             }
  13.         }
  14.         for (float a = 0; a < 20; a++)
  15.         {
  16.             float DownY = Blocks[1].transform.position.y - a - 1;
  17.             for (int i = 0; i < 20; i++)
  18.             {
  19.                 for (int j = 0; j < 20; j++)
  20.                 {
  21.                     float Zed = Blocks[1].transform.position.z + j;
  22.                     Instantiate(Blocks[1], new Vector3(Blocks[1].transform.position.x + i, DownY, Zed), new Quaternion(0, 0, 0, 0));
  23.                 }
  24.             }
  25.         }
  26.     }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement