{"record":{"id":"b3e27084cce83ab9","repo":"EllanJiang/GameFramework","slug":"entity-group-0-is-not-exist","errorCode":null,"errorMessage":"Entity group '{0}' is not exist.","messagePattern":"Entity group '(.+?)' is not exist\\.","errorType":"exception","errorClass":"GameFrameworkException","httpStatus":null,"severity":"error","filePath":"GameFramework/Entity/EntityManager.cs","lineNumber":643,"sourceCode":"            if (string.IsNullOrEmpty(entityGroupName))\n            {\n                throw new GameFrameworkException(\"Entity group name is invalid.\");\n            }\n\n            if (HasEntity(entityId))\n            {\n                throw new GameFrameworkException(Utility.Text.Format(\"Entity id '{0}' is already exist.\", entityId));\n            }\n\n            if (IsLoadingEntity(entityId))\n            {\n                throw new GameFrameworkException(Utility.Text.Format(\"Entity '{0}' is already being loaded.\", entityId));\n            }\n\n            EntityGroup entityGroup = (EntityGroup)GetEntityGroup(entityGroupName);\n            if (entityGroup == null)\n            {\n                throw new GameFrameworkException(Utility.Text.Format(\"Entity group '{0}' is not exist.\", entityGroupName));\n            }\n\n            EntityInstanceObject entityInstanceObject = entityGroup.SpawnEntityInstanceObject(entityAssetName);\n            if (entityInstanceObject == null)\n            {\n                int serialId = ++m_Serial;\n                m_EntitiesBeingLoaded.Add(entityId, serialId);\n                m_ResourceManager.LoadAsset(entityAssetName, priority, m_LoadAssetCallbacks, ShowEntityInfo.Create(serialId, entityId, entityGroup, userData));\n                return;\n            }\n\n            InternalShowEntity(entityId, entityAssetName, entityGroup, entityInstanceObject.Target, false, 0f, userData);\n        }\n\n        /// <summary>\n        /// 隐藏实体。\n        /// </summary>\n        /// <param name=\"entityId\">实体编号。</param>","sourceCodeStart":625,"sourceCodeEnd":661,"githubUrl":"https://github.com/EllanJiang/GameFramework/blob/d0c010b05167c58e92350449d04864a91ca13fd2/GameFramework/Entity/EntityManager.cs#L625-L661","documentation":"ShowEntity requires the entityGroupName to reference an entity group previously registered with AddEntityGroup. When GetEntityGroup cannot find the group, this exception is thrown. Groups manage instance pools and priorities, so an unknown group name cannot host the entity.","triggerScenarios":"Calling ShowEntity with a group name never passed to AddEntityGroup, or after the group was removed (RemoveEntityGroup).","commonSituations":"Typo in group name string (case-sensitive mismatch); group registered in another scene's bootstrap only; group removed during cleanup but entities still shown into it; config table references a renamed group.","solutions":["Call AddEntityGroup(groupName, ...) in initialization before showing entities","Fix the group name string to match the registered name exactly","Check GetEntityGroup(groupName) != null before ShowEntity"],"exampleFix":"// before\nm_EntityComponent.ShowEntity(id, \"Player\", \"PlayerGrop\", null); // typo\n// after\nif (m_EntityComponent.HasEntityGroup(\"PlayerGroup\"))\n{\n    m_EntityComponent.ShowEntity(id, \"Player\", \"PlayerGroup\", null);\n}","handlingStrategy":"validation","validationCode":"if (entityManager.GetEntityGroup(entityGroupName) == null) throw new InvalidOperationException($\"Group '{entityGroupName}' not registered\");","typeGuard":"bool GroupExists(string name) => entityManager.GetEntityGroup(name) != null;","tryCatchPattern":"try { ShowEntity(id, asset, group, userData); } catch (GameFrameworkException ex) when (ex.Message.Contains(\"Entity group\") && ex.Message.Contains(\"not exist\")) { Debug.LogError($\"Unregistered group: {group}\"); }","preventionTips":["Register all entity groups in a single bootstrap","Use constants for group names","Log registered groups at startup to catch typos"],"tags":["unity","gameframework","entity","config"],"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-15T23:17:13.987Z"}