private void ParseInfoJson(bool result, IRes res) { //UnityEngine.Debug.Log($"{InfoUrl} -> {result}"); if (result) { string str = Encoding.UTF8.GetString(res.Datas); JsonData jsonData = JsonParser.GetData(str); currNode = new TreeNode <NodeData>(new NodeData(infoName)); jsonTree = new GenericTree <NodeData>(currNode); TraverseCreate(jsonData, currNode); Check(currNode); view.ShowJsonTree(true); ShowNodeDirItems(); sView.Show(false); mask.SetActive(false); WindowAnimation.Instance.ShowDownloadWindow(null); } }
public void LoadTree(TreeNode <NodeData> node) { if (node.Data.State == NodeDataState.Unload) { List <TreeNode <NodeData> > loads = new List <TreeNode <NodeData> >(); TraverseSelect(node, loads); GenericTree <NodeData> .Traverse(node, (nd) => nd.Data.State = NodeDataState.Loading); string[] urls = new string[loads.Count]; for (int i = 0; i < loads.Count; i++) { urls[i] = LoadUrlHelper.GetJsonUrl(GetPathWithoutRoot(loads[i]) + suffix); } ILoader loader = DownloadManager.Instance.GetDownloader(node.Data.Name, urls, ResType.Json, ParseLoadJson); loader.RegisterEvent(progressCtl.LoaderFinish); if (loads.Count > 0) { progressCtl.AddLoader(loader); Debug($"新增{loads.Count}个请求"); } } }