public bool SaveData(string path, FlexGrid2D grid) { ShipData sd = new ShipData(); sd.gridConfig = new GridConfig(grid.cellX, grid.cellY, grid.top, grid.bottom, grid.left, grid.right); foreach (var kv in grid.GetPlace) { ShipItemConfig sic = new ShipItemConfig(kv.Value.name, kv.Key.x, kv.Key.y); sd.shipItemConfigs.Add(sic); } return(SaveData(path, sd)); }
public bool SaveData(string path, ShipData data) { string json = JsonUtility.ToJson(data); return(MyTools.WriteJson <ShipData> (path, json)); }