private void GenerateTileView(int x, int y) { var gridPosition = new Vector2Int(x, y); grid[x, y].tile = AddTile(gridPosition); grid[x, y].overlay = AddOverlay(gridPosition); Checkerboard.TileState tile = checkerboard.GetAt(gridPosition); if (tile != Checkerboard.TileState.None) { grid[x, y].pieceView = AddPiece(gridPosition, isWhite: tile == Checkerboard.TileState.White); } }
private void CheckerboardOnPieceAdded(Checkerboard sender, Vector2Int position) { ClearSelection(); grid[position.x, position.y].pieceView = AddPiece(position, sender.GetAt(position) == Checkerboard.TileState.White); }