{"record":{"id":"e49f7160f9aac84e","repo":"EllanJiang/GameFramework","slug":"resource-load-type-0-is-not-supported","errorCode":null,"errorMessage":"Resource load type '{0}' is not supported.","messagePattern":"Resource load type '(.+?)' is not supported\\.","errorType":"exception","errorClass":"GameFrameworkException","httpStatus":null,"severity":"error","filePath":"GameFramework/Resource/ResourceManager.ResourceLoader.LoadResourceAgent.cs","lineNumber":236,"sourceCode":"                        {\n                            m_Helper.ReadFile(fullPath);\n                        }\n                    }\n                    else if (resourceInfo.LoadType == LoadType.LoadFromMemory || resourceInfo.LoadType == LoadType.LoadFromMemoryAndQuickDecrypt || resourceInfo.LoadType == LoadType.LoadFromMemoryAndDecrypt)\n                    {\n                        if (resourceInfo.UseFileSystem)\n                        {\n                            IFileSystem fileSystem = m_ResourceLoader.m_ResourceManager.GetFileSystem(resourceInfo.FileSystemName, resourceInfo.StorageInReadOnly);\n                            m_Helper.ReadBytes(fileSystem, resourceInfo.ResourceName.FullName);\n                        }\n                        else\n                        {\n                            m_Helper.ReadBytes(fullPath);\n                        }\n                    }\n                    else\n                    {\n                        throw new GameFrameworkException(Utility.Text.Format(\"Resource load type '{0}' is not supported.\", resourceInfo.LoadType));\n                    }\n\n                    return StartTaskStatus.CanResume;\n                }\n\n                /// <summary>\n                /// 重置加载资源代理。\n                /// </summary>\n                public void Reset()\n                {\n                    m_Helper.Reset();\n                    m_Task = null;\n                }\n\n                private static bool IsAssetLoading(string assetName)\n                {\n                    return s_LoadingAssetNames.Contains(assetName);\n                }","sourceCodeStart":218,"sourceCodeEnd":254,"githubUrl":"https://github.com/EllanJiang/GameFramework/blob/d0c010b05167c58e92350449d04864a91ca13fd2/GameFramework/Resource/ResourceManager.ResourceLoader.LoadResourceAgent.cs#L218-L254","documentation":"Resources carry a LoadType (LoadFromBinary / LoadFromFile / LoadFromMemory, depending on build settings per resource). Start dispatches to the matching helper API (ReadFile/ReadBytes/etc.); if the enum value is unrecognized it throws this formatted error including the type value.","triggerScenarios":"A ResourceInfo whose LoadType is not one the loader handles — e.g. corrupt/incomplete resource metadata from the package, resources built by a mismatched GameFramework/ResourceEditor version, or a custom enum value added without extending the Start switch.","commonSituations":"Resource package built with a different GameFramework ResourceEditor version than the runtime; hand-edited or stale resource collection metadata; custom LoadType extension not reflected in LoadResourceAgent.Start; mixing builds of streaming assets and AssetBundles.","solutions":["Rebuild the resource package with the same GameFramework ResourceEditor version used at runtime so LoadType values match.","Ensure every enum value your build can emit has a corresponding branch in LoadResourceAgent.Start.","Regenerate resource metadata (resource collection) if it was hand-edited or corrupted.","Update GameFramework runtime and editor packages together to keep LoadType definitions in sync."],"exampleFix":"// before\nelse\n{\n    throw new GameFrameworkException(Utility.Text.Format(\"Resource load type '{0}' is not supported.\", resourceInfo.LoadType));\n}\n// after\ncase LoadType.LoadFromMemory:\n    m_Helper.ReadBytes(fullPath); // add handling for the new type\n    break;","handlingStrategy":"try-catch","validationCode":"if (resourceInfo.LoadType != LoadType.LoadFromBinary\n    && resourceInfo.LoadType != LoadType.LoadFromFile\n    && resourceInfo.LoadType != LoadType.LoadFromMemory)\n{\n    Debug.LogError($\"Unsupported LoadType {resourceInfo.LoadType} — rebuild resource package with matching GameFramework version.\");\n}","typeGuard":null,"tryCatchPattern":"try\n{\n    resourceComponent.LoadAsset(assetName, assetType, callback);\n}\ncatch (GameFrameworkException ex) when (ex.Message.Contains(\"is not supported\"))\n{\n    Debug.LogError(\"Resource package built with incompatible LoadType; rebuild resources with the same GameFramework ResourceEditor version.\");\n}","preventionTips":["Rebuild resource packages with the same GameFramework runtime/editor version.","Keep LoadType enums in sync between editor build tools and runtime.","Never hand-edit resource metadata files.","If adding a custom LoadType, extend LoadResourceAgent.Start with the matching branch."],"tags":["gameframework","unity","unsupported-enum-value","resource-loading","build-mismatch"],"backgroundTag":"unsupported-enum-value","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"}