Answer the question
In order to leave comments, you need to log in
How to correctly set the dimensions of the camera?
I'm trying to build a grid on the stage (andriod), it turns out that
How to build a grid so that the camera is in the center of the grid, while moving the camera does not go beyond the grid?
My script is like this
public class Cells : MonoBehaviour{
public GameObject Cell;
const float SizeW = 1f;
const float SizeH = 1f;
public int WidthTable = 10;
public int HeightTable = 10;
void Start(){
for (int y = 0; y < HeightTable; y++){
for (int x = 0; x < WidthTable; x++){
Vector2 pos = new Vector2 (y * SizeW, x * SizeH);
GameObject cell = Instantiate (Cell, pos, Quaternion.identity) as GameObject;
}
}
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question