Exemple #1
0
        private void SetPiecePosition(TileUI tileUI)
        {
            currentTileUI = tileUI;
            RectTransform tileRect = currentTileUI.GetRectTransform();

            rectTransform.anchorMin        = tileRect.anchorMin;
            rectTransform.anchorMax        = tileRect.anchorMax;
            rectTransform.anchoredPosition = Vector2.zero;
        }
Exemple #2
0
        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));
                }
            }
        }
Exemple #3
0
 private void MovePiece(TileUI tileUI)
 {
     SetPiecePosition(tileUI);
 }
Exemple #4
0
 private void OnPieceMoved(Tile oldTile, Tile newTile)
 {
     currentTileUI = board.GetTileUI(newTile);
     MovePiece(newTile);
 }
Exemple #5
0
 public void SetPointedTile(TileUI pointedTile)
 {
     currentlyPointedTile = pointedTile;
 }