{"record":{"id":"91469770ef11511c","repo":"egametang/ET","slug":"not-found-scene-type-type-scenename","errorCode":null,"errorMessage":"not found scene type: {type} {sceneName}","messagePattern":"not found scene type: (.+?) (.+?)","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"Packages/cn.etetet.core/Scripts/Core/Share/Entity/SceneTypeSingleton.cs","lineNumber":43,"sourceCode":"            return false;\n        }\n        \n        public void Awake(Type type)\n        {\n            Init(type);\n        }\n\t\t\n        public string GetSceneName(int sceneType)\n        {\n            return this.GetStringByValue(sceneType);\n        }\n\t\t\n        public int GetSceneType(string sceneName)\n        {\n            int type = this.GetValueByName(sceneName);\n            if (type == 0)\n            {\n                throw new Exception($\"not found scene type: {type} {sceneName}\");\n            }\n            return type;\n        }\n\n        public Dictionary<int, string> GetAll()\n        {\n            return this.enumValueString.GetAll();\n        }\n    }\n}","sourceCodeStart":25,"sourceCodeEnd":53,"githubUrl":"https://github.com/egametang/ET/blob/5cab01f7a8bee5f49f4781eebe9e2b1c6d7ebe0f/Packages/cn.etetet.core/Scripts/Core/Share/Entity/SceneTypeSingleton.cs#L25-L53","documentation":"Thrown by SceneTypeSingleton.GetSceneType when the scene name is unknown. The singleton maps scene names to integer codes (built from enums at startup); a name that resolves to 0 means it was never registered, which is treated as a misconfiguration.","triggerScenarios":"Calling GetSceneType with a scene name not present in the registered enum set; typo in a scene name string; scene type enum regen/registration not run; querying before the singleton is populated.","commonSituations":"Renaming a scene without regenerating the enum codegen; passing a localized/aliased name instead of the registered enum name; querying scene type during bootstrap before codegen data loads.","solutions":["Use the exact registered scene name (match the codegen enum), and regenerate scene-type codegen after renames.","Ensure SceneTypeSingleton is initialized before GetSceneType is called.","Validate the name exists via GetAll() during development to catch typos."],"exampleFix":"// before\nint st = SceneTypeSingleton.Instance.GetSceneType(\"MapScne\");   // typo\n\n// after\nint st = SceneTypeSingleton.Instance.GetSceneType(\"MapScene\");","handlingStrategy":"validation","validationCode":"var all = SceneTypeSingleton.Instance.GetAll();\nif (all.ContainsValue(sceneName))\n{\n    int st = SceneTypeSingleton.Instance.GetSceneType(sceneName);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use the exact codegen-registered scene name.","Regenerate scene-type codegen after renames.","Ensure SceneTypeSingleton is initialized before queries."],"tags":["scene","scenetype","codegen","config","core"],"backgroundTag":null,"analyzedSha":"5cab01f7a8bee5f49f4781eebe9e2b1c6d7ebe0f","analyzedAt":"2026-08-13T21:10:40.377Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}