public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) { JObject item = JObject.Load(reader); var result = new ScheduleGraph.Bundle { Name = item["Name"].Value <string>() }; if (!(item["Nodes"] is JArray nodes)) { return(result); }
public static bool Patch_ScheduleLoad(SchedulerComponent __instance, ref ScheduleGraph __result, string path) { // 取消Dictionary Cache,性能不太可能有问题 if (string.IsNullOrEmpty(path)) { Heluo.Logger.Log("排程为空", Heluo.Logger.LogLevel.ERROR, "white", "GetScheduleGraph", "C:\\PathOfWuxia\\PathOfWuxia\\Assets\\Scripts\\Features\\SchedulerComponent.cs", 162); __result = null; return(false); } try { ScheduleGraph.Bundle bundle = ModJson.FromJsonResource <ScheduleGraph.Bundle>(path, true); __result = new ScheduleGraph(bundle); } catch { Heluo.Logger.Log("Path = " + path + " 解析失败", Heluo.Logger.LogLevel.ERROR, "white", "GetScheduleGraph", "C:\\PathOfWuxia\\PathOfWuxia\\Assets\\Scripts\\Features\\SchedulerComponent.cs", 162); __result = null; } return(false); }