예제 #1
0
 public static void GetBigMapDateInSavedate()
 {
     if (_mapSaveDate == null)
     {
         _mapSaveDate = GameSaveDate.GetInstance().GetMapSaveDateByName();
     }
 }
예제 #2
0
    //************************************ 地图数据的 存储 ******************************************************************************
    //记录生成地图 地形 等数据
    public void SaveMapDateByURLName(MapSaveDate date, string URL = "MAPDATE")
    {
        string _fileURL2 = Application.persistentDataPath + "/" + URL;
        //if (Globals.isDebug) Debug.Log("_fileURL2> "+ _fileURL2);
        string s = SerializeObject(date, typeof(MapSaveDate));

        //创建XML文件且写入数据
        CreateTextFile(_fileURL2, s, false);
    }
예제 #3
0
 public static void ClearMapSaveDate()
 {
     _mapSaveDate = GameSaveDate.GetInstance().GetMapSaveDateByName();
     if (_mapSaveDate == null)
     {
         _mapSaveDate = new MapSaveDate();
     }
     _mapSaveDate.BigMapDate = "";
     _mapSaveDate.MapDate    = "";
     SaveMapDateInMapDate();
 }
예제 #4
0
    public MapSaveDate GetMapSaveDateByName(string cGKDateName = "MAPDATE")
    {
        // _fileName = Application.persistentDataPath + "/" + _fileName;
        string str = Application.persistentDataPath + "/" + cGKDateName;

        //if(Globals.isDebug)Debug.Log(str);
        try
        {
            string strTemp = LoadTextFile(str, false);
            //反序列化对象
            MapSaveDate userD = DeserializeObject(strTemp, typeof(MapSaveDate)) as MapSaveDate;
            //if (Globals.isDebug) Debug.Log(userD.userName);
            return(userD);
        }
        catch
        {
            if (Globals.isDebug)
            {
                Debug.Log("系统读取 地图 XML出现错误,请检查");
            }
        }
        return(null);
    }