Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class SoldierBuilder //singleton
- {
- function build()
- {
- //encapsulates a bunch of object creations, some of which create their own subobjects, etc. in order to build this whole soldier
- }
- }
- for each (record in soldierToBeBuiltRecords) //comes from a data file
- builder.build(record)
- int Size = 10; //Number of objects
- GameObject[] Tiles = new GameObject[Size];
- //Loop for the entire size of the array, 10 in this case
- for (int i = 0; i < Size; i++)
- {
- //Create the game object
- Tiles[i] = GameObject.Instantiate (Resources.Load ("Tile")) as GameObject;
- //Position it in the scene
- Tiles[i].transform.position = new Vector3(i * 0.32f, 0, 0);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement