网站收录查询爱站百度账号官网
2026/4/18 17:22:28 网站建设 项目流程
网站收录查询爱站,百度账号官网,潍坊 互联网公司,全球搜索GitHub地址 当选中多个资源 查找引用时#xff0c;有的资源引用不显示#xff0c;解决方法#xff1a; 把ReferenceFinderWindow脚本原来的 while(stack.Count 0) { … if (!memo.ContainsKey(current[0])) { … } } 替换为下面这段。 // 替换原来的 while(stack.Cou…GitHub地址当选中多个资源 查找引用时有的资源引用不显示解决方法把ReferenceFinderWindow脚本原来的 while(stack.Count 0) { … if (!memo.ContainsKey(current[0])) { … } } 替换为下面这段。// 替换原来的 while(stack.Count 0) { ... } 整段varretryCountnewDictionarystring,int();while(stack.Count0){varcurrentstack.Pop();stringguidcurrent[0];intcurDepthint.Parse(current[1]);stringparentGuidcurrent[2];// CreateTree 会在 memo 里返回已存在的节点或新建一个并加入 memovarchildCreateTree(guid,refelementCount,curDepth,stack,memo);if(childnull)continue;if(string.IsNullOrEmpty(parentGuid)){// 直接挂到根避免重复if(root.childrennull||!root.children.Contains(child))root.AddChild(child);continue;}// 父节点已存在则直接挂上去避免重复if(memo.TryGetValue(parentGuid,outAssetViewItemparentItem)){if(parentItem.childrennull||!parentItem.children.Contains(child))parentItem.AddChild(child);// 成功挂上重试计数可清除若有if(retryCount.ContainsKey(guid))retryCount.Remove(guid);continue;}else{// 父节点还不存在重试逻辑将当前项压回栈等待父节点被创建intattempts0;retryCount.TryGetValue(guid,outattempts);attempts;retryCount[guid]attempts;if(attempts4)// 重试上限可调整{stack.Push(current);// 稍后再试一次}else{// 父节点长时间未出现 - 降级把它挂到 root避免死循环if(root.childrennull||!root.children.Contains(child))root.AddChild(child);retryCount.Remove(guid);Debug.LogWarning($ReferenceFinder: parent{parentGuid}for{guid}not found after retries, attached to root.);}}}思路不再在外面直接跳过 memo 已有项改为 总是拿到节点CreateTree 自身会返回已存在的 memo 项然后尝试把它挂到当前父节点上如果父节点还没创建则把当前项压回栈并记录重试次数避免无限循环。加了个 retryCount 字典若某节点连续多次尝试仍然找不到父节点则把它挂到 root降级处理避免死循环。

需要专业的网站建设服务?

联系我们获取免费的网站建设咨询和方案报价,让我们帮助您实现业务目标

立即咨询