Ejemplo n.º 1
0
    private void LoadPuzzle()
    {
        SwapPuzzleData data = SaveSystem.LoadSwapPuzzle();

        pieceCount      = data.GetPieceCount();
        paintingIndex   = data.GetPaintIndex();
        isRotateEnabled = data.GetIsRotateEnable();
        complexity      = data.GetComplexityFactor();
        swapPuzzle      = new SwapPuzzle(complexity, isRotateEnabled, paintingIndex, pieceCount, cellsParent, glowShader);
        swapPuzzle.LoadSwapPuzzle(data);
    }
    public void LoadSwapPuzzle(SwapPuzzleData data)
    {
        SetCellsParentSprite();

        if (data.GetIsRotateEnable().Equals(true))
        {
            invertedCellCount = data.GetInvertedCount();
        }
        else
        {
            invertedCellCount = 0;
        }

        shiftedCellCount = data.GetShiftedCount();

        BuildCells(true, data.GetRandomPozitions(), data.GetRotations());

        SetSwapCellsAdjacents();

        selectedCell = cells[data.GetIndexOfSelectedPuzzle()];
        selectedCell.GetComponent <SwapCell>().SetPuzzlePieceGlow(true);
    }