Advertisement
Guest User

Untitled

a guest
Jul 20th, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. public class ReplicateMesh : MonoBehaviour
  2. {
  3. public int rows;
  4. public int columns;
  5. public GameObject meshPrefab;
  6.  
  7. public void Start()
  8. {
  9. if (meshPrefab == null)
  10. return;
  11.  
  12. for (int rowIndex=0; rowIndex < rows; rowIndex++)
  13. for (int colIndex = 0; colIndex < columns; colIndex++)
  14. Instantiate(meshPrefab, new Vector3(rowIndex - rows/2f, 0, colIndex - columns/2f), Quaternion.identity, this.transform);
  15. }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement