Advertisement
Guest User

Untitled

a guest
Jun 30th, 2015
223
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. class SoldierBuilder //singleton
  2. {
  3. function build()
  4. {
  5. //encapsulates a bunch of object creations, some of which create their own subobjects, etc. in order to build this whole soldier
  6. }
  7. }
  8.  
  9. for each (record in soldierToBeBuiltRecords) //comes from a data file
  10. builder.build(record)
  11.  
  12. int Size = 10; //Number of objects
  13. GameObject[] Tiles = new GameObject[Size];
  14.  
  15. //Loop for the entire size of the array, 10 in this case
  16. for (int i = 0; i < Size; i++)
  17. {
  18. //Create the game object
  19. Tiles[i] = GameObject.Instantiate (Resources.Load ("Tile")) as GameObject;
  20.  
  21. //Position it in the scene
  22. Tiles[i].transform.position = new Vector3(i * 0.32f, 0, 0);
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement