{"record":{"id":"e6738ff394bacaf0","repo":"EllanJiang/GameFramework","slug":"you-can-not-use-updateresources-at-this-time","errorCode":null,"errorMessage":"You can not use UpdateResources at this time.","messagePattern":"You can not use UpdateResources at this time\\.","errorType":"validation","errorClass":"GameFrameworkException","httpStatus":null,"severity":"error","filePath":"GameFramework/Resource/ResourceManager.cs","lineNumber":1316,"sourceCode":"        {\n            if (updateResourcesCompleteCallback == null)\n            {\n                throw new GameFrameworkException(\"Update resources complete callback is invalid.\");\n            }\n\n            if (m_ResourceMode == ResourceMode.Unspecified)\n            {\n                throw new GameFrameworkException(\"You must set resource mode first.\");\n            }\n\n            if (m_ResourceMode != ResourceMode.Updatable && m_ResourceMode != ResourceMode.UpdatableWhilePlaying)\n            {\n                throw new GameFrameworkException(\"You can not use UpdateResources without updatable resource mode.\");\n            }\n\n            if (m_ResourceUpdater == null)\n            {\n                throw new GameFrameworkException(\"You can not use UpdateResources at this time.\");\n            }\n\n            ResourceGroup resourceGroup = (ResourceGroup)GetResourceGroup(resourceGroupName);\n            if (resourceGroup == null)\n            {\n                throw new GameFrameworkException(Utility.Text.Format(\"Can not find resource group '{0}'.\", resourceGroupName));\n            }\n\n            m_UpdateResourcesCompleteCallback = updateResourcesCompleteCallback;\n            m_ResourceUpdater.UpdateResources(resourceGroup);\n        }\n\n        /// <summary>\n        /// 停止更新资源。\n        /// </summary>\n        public void StopUpdateResources()\n        {\n            if (m_ResourceMode == ResourceMode.Unspecified)","sourceCodeStart":1298,"sourceCodeEnd":1334,"githubUrl":"https://github.com/EllanJiang/GameFramework/blob/d0c010b05167c58e92350449d04864a91ca13fd2/GameFramework/Resource/ResourceManager.cs#L1298-L1334","documentation":"This GameFrameworkException is thrown by ResourceManager.UpdateResources when m_ResourceUpdater is null despite being in a valid updatable mode — the resource updater has not been created/initialized yet. The manager cannot perform a group update without its updater component, so it rejects the call. It is a readiness-state guard.","triggerScenarios":"Calling UpdateResources after mode setup but before the update pipeline instantiated the updater; calling it before the version-check flow that creates the updater; custom bootstraps skipping the update startup.","commonSituations":"Update UI triggering group updates before the version-check step completes; calling update APIs too early in startup; third-party integrations that bypass the standard flow.","solutions":["Call UpdateResources only after the update flow has started and the updater exists (e.g. after successful version check).","Follow the standard order: set updatable mode, run version check/update version flow, then update resource groups.","Verify the resource update helper chain is registered so the updater gets created."],"exampleFix":"// before\nresourceManager.Initialize(ResourceMode.Updatable, ...);\nresourceManager.UpdateResources(\"MyGroup\", callback); // updater null\n// after\nresourceManager.Initialize(ResourceMode.Updatable, ...);\n// after version check completes and updater is created:\nresourceManager.UpdateResources(\"MyGroup\", callback);","handlingStrategy":"try-catch","validationCode":"StartUpdateFlow(onReady: () => resourceManager.UpdateResources(groupName, callback));","typeGuard":null,"tryCatchPattern":"try { resourceManager.UpdateResources(groupName, callback); }\ncatch (GameFrameworkException ex) when (ex.Message.Contains(\"at this time\")) { UnityEngine.Debug.LogError(\"Resource updater not ready; wait for version check to complete.\"); }","preventionTips":["Call UpdateResources only after the updater exists (post version check).","Do not chain updater calls directly after Initialize.","Gate update UI behind updater-ready state."],"tags":["csharp","gameframework","not-initialized","lifecycle"],"backgroundTag":"missing-dependency","analyzedSha":"d0c010b05167c58e92350449d04864a91ca13fd2","analyzedAt":"2026-09-15T13:37:15.352Z","contentChangedAt":"2026-09-15T13:37:15.352Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}