Exemplo n.º 1
0
    private void PlaceFigureOnBoard(GridCell spawnCell)
    {
        BoardGrid board = BoardGrid.GetInstance();

        board.InverseMarks(spawnCell.CellPosition, figureStruct.partsPositions, true);
        board.CheckWin();
        StartCoroutine(DestroyFigure());
    }
Exemplo n.º 2
0
 public void OnPointerUp(PointerEventData eventData)
 {
     if (!isDragging)
     {
         return;
     }
     isDragging = false;
     if (gridCell != null && BoardGrid.GetInstance().CanPlaceFigure(gridCell.GetComponent <GridCell>(), figureStruct.figureSize))
     {
         figureTransform.localPosition = new Vector3(gridCell.transform.position.x, gridCell.transform.position.y, figureTransform.localPosition.z);
         PlaceFigureOnBoard(gridCell.GetComponent <GridCell>());
         FigureSpawner.GetInstance().DeleteFigure(figureIndex);
     }
     else
     {
         StartCoroutine(MoveFigureToStartPosition());
     }
 }
Exemplo n.º 3
0
 public void InverseBoardMarks(Vector2Int spawnPosition)
 {
     BoardGrid.GetInstance().InverseMarks(spawnPosition, figureStruct.partsPositions, false);
 }