Ejemplo n.º 1
0
    public static JSonIO Instance(JSonUtilType jSonUtilType = JSonUtilType.JsonUtility)
    {
        if (instance == null)
        {
            instance = SingletonProperty <JSonIO> .Instance();

            instance.jSonUtilType = jSonUtilType;
        }

        return(instance);
    }
Ejemplo n.º 2
0
 /// <summary>
 /// 读取Json文件
 /// </summary>
 /// <typeparam name="T">返回对象类型</typeparam>
 /// <param name="data">文件数据</param>
 /// <returns>返回模型对象</returns>
 public static T ReadJsonData <T>(string data, JSonUtilType jSonUtilType = JSonUtilType.JsonUtility)
 {
     return(JSonIO.Instance(jSonUtilType).ReadData <T>(data));
 }
Ejemplo n.º 3
0
 /// <summary>
 /// 读取Json文件
 /// </summary>
 /// <typeparam name="T">返回对象类型</typeparam>
 /// <param name="path">文件路径</param>
 /// <returns>返回模型对象</returns>
 public static T JsonFile <T>(string path, JSonUtilType jSonUtilType = JSonUtilType.JsonUtility)
 {
     return(JSonIO.Instance(jSonUtilType).Read <T>(path));
 }