// Start is called before the first frame update void Start() { mapGenerator = GameObject.Find("TileMap").GetComponent <MapGenerations>(); previousLocation.x = Mathf.RoundToInt(transform.position.x); previousLocation.y = Mathf.RoundToInt(transform.position.z); previousLocationRAW = transform.position; flagCount = MapGenerations.bombCount; gameUIHelper.SetFlagCount(flagCount.ToString()); }
public static void SaveMap(MapGenerations map) { BinaryFormatter formatter = new BinaryFormatter(); FileStream stream = new FileStream(mapPath, FileMode.Create); MapData data = new MapData(MapGenerations.xSize, MapGenerations.zSize, map.map, map.GetRevealedBool(), GameUIHelper.playTime, MapGenerations.bombCount, MapGenerations.difficulity, map.GetFlaggedMap()); formatter.Serialize(stream, data); stream.Close(); Debug.Log("Map file saved at: " + mapPath); }