Exemplo n.º 1
0
 // 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());
 }
Exemplo n.º 2
0
    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);
    }