{"record":{"id":"32c0268a033e1836","repo":"EllanJiang/GameFramework","slug":"can-not-find-ui-form-info","errorCode":null,"errorMessage":"Can not find UI form info.","messagePattern":"Can not find UI form info\\.","errorType":"exception","errorClass":"GameFrameworkException","httpStatus":null,"severity":"error","filePath":"GameFramework/UI/UIManager.UIGroup.cs","lineNumber":383,"sourceCode":"                if (!m_UIFormInfos.Remove(uiFormInfo))\n                {\n                    throw new GameFrameworkException(Utility.Text.Format(\"UI group '{0}' not exists specified UI form '[{1}]{2}'.\", m_Name, uiForm.SerialId, uiForm.UIFormAssetName));\n                }\n\n                ReferencePool.Release(uiFormInfo);\n            }\n\n            /// <summary>\n            /// 激活界面。\n            /// </summary>\n            /// <param name=\"uiForm\">要激活的界面。</param>\n            /// <param name=\"userData\">用户自定义数据。</param>\n            public void RefocusUIForm(IUIForm uiForm, object userData)\n            {\n                UIFormInfo uiFormInfo = GetUIFormInfo(uiForm);\n                if (uiFormInfo == null)\n                {\n                    throw new GameFrameworkException(\"Can not find UI form info.\");\n                }\n\n                m_UIFormInfos.Remove(uiFormInfo);\n                m_UIFormInfos.AddFirst(uiFormInfo);\n            }\n\n            /// <summary>\n            /// 刷新界面组。\n            /// </summary>\n            public void Refresh()\n            {\n                LinkedListNode<UIFormInfo> current = m_UIFormInfos.First;\n                bool pause = m_Pause;\n                bool cover = false;\n                int depth = UIFormCount;\n                while (current != null && current.Value != null)\n                {\n                    LinkedListNode<UIFormInfo> next = current.Next;","sourceCodeStart":365,"sourceCodeEnd":401,"githubUrl":"https://github.com/EllanJiang/GameFramework/blob/d0c010b05167c58e92350449d04864a91ca13fd2/GameFramework/UI/UIManager.UIGroup.cs#L365-L401","documentation":"RefocusUIForm moves the given form's UIFormInfo to the front of the group's list and raises the refocus lifecycle event. It throws GameFrameworkException('Can not find UI form info.') when the form instance is not tracked by this group.","triggerScenarios":"Calling UIGroup.RefocusUIForm with a form opened in another group; refocusing a form that was already closed; passing a form whose SerialId no longer exists in this group.","commonSituations":"Refocusing a cached form reference after the form was closed; group reassignment during hierarchy changes; refocus calls from stale dialog-manager bookkeeping.","solutions":["Only call RefocusUIForm with forms that are currently open in this specific group","Check the form's validity/open state before refocusing","Clear cached references when forms close"],"exampleFix":"// before\nuiGroup.RefocusUIForm(cachedForm, userData); // cachedForm may be closed\n// after\nif (cachedForm != null && cachedForm.Id > 0 && m_OpenForms.Contains(cachedForm))\n{\n    uiGroup.RefocusUIForm(cachedForm, userData);\n}","handlingStrategy":"validation","validationCode":"if (uiForm == null || !m_OpenForms.Contains(uiForm)) return;","typeGuard":"bool IsOpenInThisGroup(IUIForm form) => form != null && uiGroup.GetUIForms(form.UIFormAssetName).Contains(form);","tryCatchPattern":"try { uiGroup.RefocusUIForm(uiForm, userData); } catch (GameFrameworkException ex) { Log.Warn($\"RefocusUIForm skipped: {ex.Message}\"); }","preventionTips":["Only refocus forms currently open in the same group","Remove stale form references from your dialog manager when forms close","Verify group membership via GetUIForms before refocusing"],"tags":["unity","gameframework","ui","state"],"backgroundTag":"resource-not-found","analyzedSha":"d0c010b05167c58e92350449d04864a91ca13fd2","analyzedAt":"2026-09-15T13:37:15.352Z","contentChangedAt":"2026-09-15T13:37:15.352Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}