Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class CubeHull : MonoBehaviour
- {
- public GameObject oggettoDaInstanziare;
- public int ripetizioni;
- public float distanza;
- void Start()
- {
- for (int x = 0; x < ripetizioni; x++)
- {
- for (int y = 0; y < ripetizioni; y++)
- {
- for (int z = 0; z < ripetizioni; z++)
- {
- if (z == 0 || z == ripetizioni - 1)
- {
- GameObject go = Instantiate(oggettoDaInstanziare, new Vector3(distanza * x, distanza * y, distanza * z), Quaternion.identity);
- }
- else if (y == 0 || y == ripetizioni - 1)
- {
- GameObject go = Instantiate(oggettoDaInstanziare, new Vector3(distanza * x, distanza * y, distanza * z), Quaternion.identity);
- }
- else if (x == 0 || x == ripetizioni - 1)
- {
- GameObject go = Instantiate(oggettoDaInstanziare, new Vector3(distanza * x, distanza * y, distanza * z), Quaternion.identity);
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement