예제 #1
0
    private void SaveMapData()
    {
        // 验证数据是否有效
        if (string.IsNullOrEmpty(MapFileId) || string.IsNullOrEmpty(MapDataFilePath))
        {
            Debug.LogError("数据错误: MapData:" + MapData);
            Debug.LogError("数据错误: MapFileName:" + MapFileId);
            Debug.LogError("数据错误: MapDataFilePath:" + MapDataFilePath);
        }
        var level = 1;

        while (MapData.Count > 0)
        {
            MapUtils.CreateOrOpenFile(MapDataFilePath, MapUtils.GetMapFileNameById(MapFileId, level), MapData.Pop());
            level++;
        }
        Debug.Log("地图文件保存成功:" + MapFileId);
    }