private void SetPiecePosition(TileUI tileUI) { currentTileUI = tileUI; RectTransform tileRect = currentTileUI.GetRectTransform(); rectTransform.anchorMin = tileRect.anchorMin; rectTransform.anchorMax = tileRect.anchorMax; rectTransform.anchoredPosition = Vector2.zero; }
public void GenerateBoard() { board = new Tile[8, 8]; for (int i = 0; i < 8; i++) { for (int j = 0; j < 8; j++) { board[i, j] = new Tile(i, j); TileUI tile = Instantiate(model, transform); tilesWithUI.Add(board[i, j], tile); tile.Initialize(this, board[i, j], artSet.GetTileArt(board[i, j].tileColor)); } } }
private void MovePiece(TileUI tileUI) { SetPiecePosition(tileUI); }
private void OnPieceMoved(Tile oldTile, Tile newTile) { currentTileUI = board.GetTileUI(newTile); MovePiece(newTile); }
public void SetPointedTile(TileUI pointedTile) { currentlyPointedTile = pointedTile; }