{"record":{"id":"57b026c754db2444","repo":"EllanJiang/GameFramework","slug":"there-are-already-some-resources-being-updated-while-playing","errorCode":null,"errorMessage":"There are already some resources being updated while playing.","messagePattern":"There are already some resources being updated while playing\\.","errorType":"validation","errorClass":"GameFrameworkException","httpStatus":null,"severity":"error","filePath":"GameFramework/Resource/ResourceManager.ResourceUpdater.cs","lineNumber":335,"sourceCode":"            {\n                if (!m_CheckResourcesComplete)\n                {\n                    throw new GameFrameworkException(\"You must check resources complete first.\");\n                }\n\n                if (m_ApplyingResourcePackStream != null)\n                {\n                    throw new GameFrameworkException(Utility.Text.Format(\"There is already a resource pack '{0}' being applied.\", m_ApplyingResourcePackPath));\n                }\n\n                if (m_UpdatingResourceGroup != null)\n                {\n                    throw new GameFrameworkException(Utility.Text.Format(\"There is already a resource group '{0}' being updated.\", m_UpdatingResourceGroup.Name));\n                }\n\n                if (m_UpdateWaitingInfoWhilePlaying.Count > 0)\n                {\n                    throw new GameFrameworkException(\"There are already some resources being updated while playing.\");\n                }\n\n                try\n                {\n                    long length = 0L;\n                    ResourcePackVersionList versionList = default(ResourcePackVersionList);\n                    using (FileStream fileStream = new FileStream(resourcePackPath, FileMode.Open, FileAccess.Read))\n                    {\n                        length = fileStream.Length;\n                        versionList = m_ResourceManager.m_ResourcePackVersionListSerializer.Deserialize(fileStream);\n                    }\n\n                    if (!versionList.IsValid)\n                    {\n                        throw new GameFrameworkException(\"Deserialize resource pack version list failure.\");\n                    }\n\n                    if (versionList.Offset + versionList.Length != length)","sourceCodeStart":317,"sourceCodeEnd":353,"githubUrl":"https://github.com/EllanJiang/GameFramework/blob/d0c010b05167c58e92350449d04864a91ca13fd2/GameFramework/Resource/ResourceManager.ResourceUpdater.cs#L317-L353","documentation":"ApplyResources throws this when there are pending while-playing resource updates (m_UpdateWaitingInfoWhilePlaying non-empty). Queued resource downloads that trigger during gameplay would conflict with applying a resource pack, so the manager rejects the call.","triggerScenarios":"Calling ApplyResources while resources are queued for download during play (e.g. a scene load requested assets that entered the while-playing update queue); applying a pack immediately after triggering scene loads.","commonSituations":"Hot-update flows that both download missing resources during play and apply a local pack; loading a scene on startup before applying the pack that contains its resources.","solutions":["Wait until all while-playing updates finish (no pending download requests) before applying the pack","Apply resource packs before starting gameplay/scene loads that enqueue while-playing updates","Check the ResourceManager update state / pending counts before calling ApplyResources"],"exampleFix":"// before\nLoadScene(\"Battle\");           // queues while-playing updates\nresourceManager.ApplyResources(packPath); // throws\n// after\nresourceManager.ApplyResources(packPath); // apply first\n// then load scenes once apply-success callback fires\nLoadScene(\"Battle\");","handlingStrategy":"try-catch","validationCode":"// ensure no while-playing updates are pending before applying\nif (m_PendingWhilePlayingUpdates) return;","typeGuard":null,"tryCatchPattern":"try { resourceManager.ApplyResources(packPath); } catch (GameFrameworkException ex) { Log.Warn(\"While-playing updates pending: \" + ex.Message); }","preventionTips":["Apply packs before triggering scene loads that may enqueue while-playing updates","Track pending download requests in game code and defer ApplyResources","Design hot-update flow as: check -> update/apply -> then load scenes"],"tags":["csharp","gameframework","concurrency","invalid-state"],"backgroundTag":"invalid-state-transition","analyzedSha":"d0c010b05167c58e92350449d04864a91ca13fd2","analyzedAt":"2026-09-15T13:37:15.352Z","contentChangedAt":"2026-09-15T13:37:15.352Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}