2015-04-23 185 views

回答

3

這很有趣,團結傢伙已經寫它看起來像正是你正在努力實現:)

​​

+0

非常感謝你:)你知道我該如何在立方體之間創建空的空間嗎? –

0

您可以實例化一個預製與2句同樣的事情爲例。

public GameObject objToCreate; 

void Start() 
{ 
    //2 for sentences to create a vidirectional array 
    for(int i = 0; i<5;i++){   //for move on Y 
     for(int j = 0; j<5;j++){  //for move on X 
      Instantiate(objToCreate, transform.position,transform.rotation); 
      transform.Translate(1f,0,0); //Move on X 
     } 
     transform.Translate(0,1f,0); //When fill X translate on Y and start again 
     transform.Translate(-5f,0,0); //Reset out transform position 5 units as set in the first for sentence 
     //For mor space between objects just change the values in Translate function 
    } 
}