Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using System.Collections;
- public class GridCreator : MonoBehaviour {
- public GameObject goTile;
- void Start () {
- //Create quaternion to use as the rotation
- //of the instantiated object
- Quaternion qRotation = new Quaternion();
- //Create Vector3 to use as the position
- //of the instantiated object
- Vector3 v3Position = new Vector3();
- //count ten X coordinates
- for(int i=0; i<10; i++)
- {
- //count ten Y coordinates
- for(int j=0; j<10; j++)
- {
- //set the X coordinate
- v3Position.x = i;
- //set the Y coordinate
- v3Position.y=j;
- //Instantiate a tile.
- Instantiate(goTile,v3Position,qRotation);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement