private void PlaceFigureOnBoard(GridCell spawnCell) { BoardGrid board = BoardGrid.GetInstance(); board.InverseMarks(spawnCell.CellPosition, figureStruct.partsPositions, true); board.CheckWin(); StartCoroutine(DestroyFigure()); }
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()); } }
public void InverseBoardMarks(Vector2Int spawnPosition) { BoardGrid.GetInstance().InverseMarks(spawnPosition, figureStruct.partsPositions, false); }