public void LoadLevel(int level) { Debug.Log("Load Level " + level, Array.Empty <object>()); this.gridInfo = Map2DUtil.LoadMapData(level); this.DoAfterInit(); this.OnLoadLevel(level, this.gridInfo); }
public static void LoadLevel(Grid grid, int level) { CheckLoadTileIDMap(); GridInfo info = Map2DUtil.LoadMapData(level); BindMapView(grid, info); }
public static GridInfo LoadMapData(int mapId) { string mapPathFull = Map2DUtil.GetMapPathFull(mapId); byte[] source = File.ReadAllBytes(mapPathFull); Deserializer reader = new Deserializer(source); return(TileMapDeserializer.ReadGrid(reader)); }
public static void SaveLevel(Grid grid, int level) { bool flag = grid == null; if (!flag) { CheckLoadTileIDMap(); byte[] array = TileMapSerializer.WriteGrid(grid, new Func <TileBase, ushort>(UnityMap2DUtil.Tile2ID)); bool flag2 = array != null; if (flag2) { File.WriteAllBytes(Map2DUtil.GetMapPathFull(level), array); } } }