コード例 #1
0
    public void LoadRotatePuzzle(RotatePuzzleData data)
    {
        falseCellCount = data.GetInvertedCount();

        SetCellsParentSprite();
        BuildCells(true, data.GetRotations());
    }
コード例 #2
0
    void LoadPuzzle()
    {
        RotatePuzzleData data = SaveSystem.LoadRotatePuzzle();

        pieceCount       = data.GetPieceCount();
        paintingIndex    = data.GetPaintIndex();
        complexityFactor = data.GetComplexityFactor();
        rotatePuzzle     = new RotatePuzzle(complexityFactor, paintingIndex, pieceCount, cellsParent, glowShader);
        rotatePuzzle.LoadRotatePuzzle(data);
    }
コード例 #3
0
    public static void SaveRotatePuzzle(RotatePuzzle rotatePuzzle)
    {
        BinaryFormatter formatter = new BinaryFormatter();
        FileStream      stream    = new FileStream(rotatePuzzleSavePath, FileMode.Create);

        RotatePuzzleData data = new RotatePuzzleData(rotatePuzzle);

        formatter.Serialize(stream, data);
        stream.Close();
    }
コード例 #4
0
    public static RotatePuzzleData LoadRotatePuzzle()
    {
        if (File.Exists(rotatePuzzleSavePath))
        {
            BinaryFormatter formatter = new BinaryFormatter();
            FileStream      stream    = new FileStream(rotatePuzzleSavePath, FileMode.Open);

            RotatePuzzleData data = formatter.Deserialize(stream) as RotatePuzzleData;
            stream.Close();
            return(data);
        }
        else
        {
            Debug.LogError("Save file not found in" + rotatePuzzleSavePath);
            return(null);
        }
    }