示例#1
0
    private void SetupTiles()
    {
        for (var i = 0; i < columns; i++)
        {
            for (var j = 0; j < rows; j++)
            {
                var tile =
                    board.InsantiateTile(i, j)
                    .SetName(string.Format("Tile [{0}:{1}]", i, j))
                    .GetComponent <GridTileBehaviour>()
                    .Init(i, j, board);

                tile.OnPress    += HandleTileClicked;
                tile.OnDragOver += HandleDragOverTile;
                tile.OnRelease  += HandleTileReleased;
                tiles[i, j]      = tile;
            }
        }
    }