EllanJiang/GameFramework · error · GameFrameworkException

You can not use ApplyResources at this time.

Error message

You can not use ApplyResources at this time.

What it means

This GameFrameworkException is thrown by ResourceManager.ApplyResources when m_ResourceUpdater is null — i.e. the resource system is in a valid updatable mode but the updater component has not been created/initialized yet. The apply operation needs the updater, so the call is rejected until it exists. It is a readiness-state guard.

Solutions

  1. Delay ApplyResources until the resource updater is ready (typically after the update pipeline has started, e.g. after UpdateVersion/version-check flow).
  2. Follow the standard GameFramework update flow order: set mode, check versions, then use updater-dependent APIs.
  3. If the flow allows it, ensure the updater helper is created and registered before applying packs.

Example fix

// before
resourceManager.Initialize(ResourceMode.Updatable, ...);
resourceManager.ApplyResources(packPath, callback); // updater not created yet
// after
resourceManager.Initialize(ResourceMode.Updatable, ...);
// start update flow first, then once the updater exists:
resourceManager.ApplyResources(packPath, callback);
Defensive patterns

Strategy: try-catch

Validate before calling

// only call after the update flow has started
StartUpdateFlow(onReady: () => resourceManager.ApplyResources(packPath, callback));

Try / catch

try { resourceManager.ApplyResources(packPath, callback); }
catch (GameFrameworkException ex) when (ex.Message.Contains("at this time")) { UnityEngine.Debug.LogError("Resource updater not ready; retry after update flow starts."); }

Prevention

When it happens

Trigger: Calling ApplyResources before the resource update pipeline has been started (updater not yet instantiated); calling it during an early lifecycle stage where only the helper chain was initialized; applying a resource pack before UpdateVersion/UpdateResources flow set up the updater.

Common situations: Calling ApplyResources immediately after initialization instead of after the update flow has begun; race where UI code triggers pack application before the updater exists; custom integrations that skip the standard update startup.

Understand the failure class

Background: "not installed", "pip install", "required for": how missing-dependency errors surface across open-source libraries — this error's family across 34 libraries.

Related errors


AI-assisted analysis of EllanJiang/GameFramework@d0c010b051 (2026-09-15). Data as JSON: /api/errors/0fec0f6a2e2d1649. Report an issue: GitHub.

Appendix: source

Thrown at GameFramework/Resource/ResourceManager.cs:1276

            if (applyResourcesCompleteCallback == null)
            {
                throw new GameFrameworkException("Apply resources complete callback is invalid.");
            }

            if (m_ResourceMode == ResourceMode.Unspecified)
            {
                throw new GameFrameworkException("You must set resource mode first.");
            }

            if (m_ResourceMode != ResourceMode.Updatable && m_ResourceMode != ResourceMode.UpdatableWhilePlaying)
            {
                throw new GameFrameworkException("You can not use ApplyResources without updatable resource mode.");
            }

            if (m_ResourceUpdater == null)
            {
                throw new GameFrameworkException("You can not use ApplyResources at this time.");
            }

            m_ApplyResourcesCompleteCallback = applyResourcesCompleteCallback;
            m_ResourceUpdater.ApplyResources(resourcePackPath);
        }

        /// <summary>
        /// 使用可更新模式并更新所有资源。
        /// </summary>
        /// <param name="updateResourcesCompleteCallback">使用可更新模式并更新默认资源组完成时的回调函数。</param>
        public void UpdateResources(UpdateResourcesCompleteCallback updateResourcesCompleteCallback)
        {
            UpdateResources(string.Empty, updateResourcesCompleteCallback);
        }

        /// <summary>
        /// 使用可更新模式并更新指定资源组的资源。
        /// </summary>

View on GitHub (pinned to d0c010b051)