18. Store the Info About All Tiles in Game Manager - Build 2048 puzzle game in Unity 3D

preview_player
Показать описание


Рекомендации по теме
Комментарии
Автор

Tile[] AllTilesOnDim =
==> cannot implicitly convert type "tilt"to"tile[]'
can someone see how to solve this mistake

Extend_Knowledge
Автор

Given that these tiles are setup so they increase from left to right, top to bottom, and that their names are sorted by alphanumeric order you can first sort by the name (if you can access it), then you can use a bit of math and some nested loops to do it for you. One example may go as follows:

for (int i = 0; i < 4; i++)
for (int j = 0; j < 4; j++) {
AllTiles[i][j] = AllTilesOneDim[i * 4 + j];
}

DuBCraft