private void BuildPuzzle() { pieceCount = MainMenuManager.pieceCount; paintingIndex = MainMenuManager.paintIndex; complexityFactor = MainMenuManager.complexityFactor; rotatePuzzle = new RotatePuzzle(complexityFactor, paintingIndex, pieceCount, cellsParent, glowShader); rotatePuzzle.BuildRotatePuzzle(); }
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(); }
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 RotatePuzzleData(RotatePuzzle rotatePuzzle) { GameObject[] cells = rotatePuzzle.GetCells(); rotations = new float[cells.Length]; for (int i = 0; i < cells.Length; i++) { rotations.SetValue(cells[i].transform.eulerAngles.z, i); } this.invertedCount = RotatePuzzle.falseCellCount; this.paintIndex = rotatePuzzle.GetPaintingIndex(); this.pieceCount = rotatePuzzle.GetPieceCount(); this.complexityFactor = rotatePuzzle.GetComplexityFactor(); }