Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class ReplicateMesh : MonoBehaviour
- {
- public int rows;
- public int columns;
- public GameObject meshPrefab;
- public void Start()
- {
- if (meshPrefab == null)
- return;
- for (int rowIndex=0; rowIndex < rows; rowIndex++)
- for (int colIndex = 0; colIndex < columns; colIndex++)
- Instantiate(meshPrefab, new Vector3(rowIndex - rows/2f, 0, colIndex - columns/2f), Quaternion.identity, this.transform);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement