Answer the question
In order to leave comments, you need to log in
How to bind objects to panel position?
There is a panel smaller than the screen area in the center, objects are displayed in it, the question is how to make the coordinates of these objects start from the border of this panel and not from the screen coordinates?
I initialize like this
public Cell2 cell2;
public GameObject PanelBoard;
public Dictionary<string, Cell2> Cells2 = new Dictionary<string, Cell2>();
void InitializationBoardTest(){
for(int y = 0; y < BoardHeight; ++y){
for(int x = 0; x < BoardWidth; ++x){
string yx = y + "-" + x;
Cells2[yx] = Instantiate(cell2, new Vector3((x * 100), (y * 100), 0), Quaternion.identity) as Cell2;
Cells2[yx].transform.parent = PanelBoard.transform;
}
}
}
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