public void buildWorldMap() { WorldMapData worldMapData = new WorldMapData(); Util.MeasureExecutionTime("world build", async() => { worldMapData = this.generateWorldMap(); await Util.AsyncCreateJsonFile("/Data", "world_map", JsonUtility.ToJson(worldMapData, true)); }); }
public async Task loadWorldMap() { var jsonData = await Util.AsyncLoadJsonFile("/Data", "world_map"); WorldMapData worldMap = JsonUtility.FromJson <WorldMapData>(jsonData); this.row = worldMap.row; this.col = worldMap.column; this.cellSize = worldMap.cellSize; this.world = worldMap.map; }