public void LoadRotatePuzzle(RotatePuzzleData data) { falseCellCount = data.GetInvertedCount(); SetCellsParentSprite(); BuildCells(true, data.GetRotations()); }
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); }
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(); }
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); } }