You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
看了下这里的加载,其中:
m_BuildInfo = Utility.Json.ToObject(m_BuildInfoTextAsset.text);
使用的 DefaultJsonHelper.ToObject
最底层使用的是:JsonUtility.FromJson(json)
JsonUtility是有不少限制的,其中反序列化的目标类型: BuildInfo,这些属性全部用的类似下面这种方式: public string GameVersion { get; set; }
这样会导致反序列化失败,这些参数都是null。
应该修改这个类为: public class BuildInfo { public string GameVersion; public int InternalGameVersion; public string CheckVersionUrl; public string WindowsAppUrl; public string MacOSAppUrl; public string IOSAppUrl; public string AndroidAppUrl; }
The text was updated successfully, but these errors were encountered:
看了下这里的加载,其中:
m_BuildInfo = Utility.Json.ToObject(m_BuildInfoTextAsset.text);
使用的 DefaultJsonHelper.ToObject
最底层使用的是:JsonUtility.FromJson(json)
JsonUtility是有不少限制的,其中反序列化的目标类型: BuildInfo,这些属性全部用的类似下面这种方式:
public string GameVersion { get; set; }
这样会导致反序列化失败,这些参数都是null。
应该修改这个类为:
public class BuildInfo { public string GameVersion; public int InternalGameVersion; public string CheckVersionUrl; public string WindowsAppUrl; public string MacOSAppUrl; public string IOSAppUrl; public string AndroidAppUrl; }
The text was updated successfully, but these errors were encountered: