/// <summary> /// 保存信息 /// </summary> /// <param name="mapInfo"></param> public static void SaveMap(List <List <int> > mapInfo) { GameInfoSaveManager.StartGetSaveInfo(); if (mapInfo.Count != virticalCount) { Debug.LogWarning("地图高度不正确"); return; } if (mapInfo[0].Count != HorizontalCount) { Debug.LogWarning("地图宽度不正确"); return; } if (_mapInfo.Count == 0) { GetMap(); //获取位置信息 x y 坐标 } List <List <MapSingleInfo> > InspectormapInfo = new List <List <MapSingleInfo> >(); for (int i = 0; i < mapInfo.Count; i++) { List <MapSingleInfo> temp = new List <MapSingleInfo>(); for (int j = 0; j < mapInfo[i].Count; j++) { MapSingleInfo elem = SetElemInfo(_mapInfo[i][j].PosX, _mapInfo[i][j].Posy.ToString(), ColorType.ColorWood, i, j, mapInfo[i][j]); temp.Add(elem); } InspectormapInfo.Add(temp); } Map map = new Map(); map._mapInfo = InspectormapInfo; _mapInfo = InspectormapInfo; string currentIndex = ShapManager.currentIndex.ToString(); GameInfoSaveManager.SaveAttributeInfo("currentIndex", currentIndex); GameInfoSaveManager.SaveClassInfo <Map>("BlockPuzzleMap", map); GameInfoSaveManager.EndSetSaveInfo(); }
/// <summary> /// 游戏开始获取存储数据 /// </summary> private void Awake() { GameInfoSaveManager.StartGetSaveInfo(); }