{"record":{"id":"c379999401ffad2e","repo":"egametang/ET","slug":"node-gettype-fullname-to-typeof-node","errorCode":null,"errorMessage":"类型转换错误: {node.GetType().FullName} to {typeof (Node).Name}","messagePattern":"类型转换错误: (.+?) to (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"Packages/cn.etetet.spell/Scripts/Model/Client/TargetSelectDispatcher.cs","lineNumber":25,"sourceCode":"    {\n    }\n    \n    public interface ITargetSelectHandler\n    {\n        ETTask<int> Handle(TargetSelector node, EntityRef<Unit> unit, SpellConfig spellConfig);\n        Type GetNodeType();\n    }\n    \n    [TargetSelectHandler]\n    public abstract class TargetSelectHandler<Node>: HandlerObject, ITargetSelectHandler where Node : TargetSelector\n    {\n        protected abstract ETTask<int> Run(Node node, EntityRef<Unit> unit, SpellConfig spellConfig);\n\n        public async ETTask<int> Handle(TargetSelector node, EntityRef<Unit> unit, SpellConfig spellConfig)\n        {\n            if (node is not Node c)\n            {\n                throw new Exception($\"类型转换错误: {node.GetType().FullName} to {typeof (Node).Name}\");\n            }\n\n            return await this.Run(c, unit, spellConfig);\n        }\n\n        public Type GetNodeType()\n        {\n            return typeof (Node);\n        }\n    }\n    \n    /// <summary>\n    /// 分发组件\n    /// </summary>\n    [CodeProcess]\n    [AllowInstance]\n    public class TargetSelectDispatcher: Singleton<TargetSelectDispatcher>, ISingletonAwake\n    {","sourceCodeStart":7,"sourceCodeEnd":43,"githubUrl":"https://github.com/egametang/ET/blob/5cab01f7a8bee5f49f4781eebe9e2b1c6d7ebe0f/Packages/cn.etetet.spell/Scripts/Model/Client/TargetSelectDispatcher.cs#L7-L43","documentation":"Error \"类型转换错误: {node.GetType().FullName} to {typeof (Node).Name}\" thrown in egametang/ET.","triggerScenarios":"TargetSelectDispatcher 中目标选择节点对象无法转换为期望的 Node 类型，节点类型与配置不匹配","commonSituations":"See trigger scenarios.","solutions":["检查配置中节点类型名与实际节点类是否一致","确认该节点类继承自期望的 Node 基类","检查程序集热更新后类型是否来自正确的程序集"],"exampleFix":"将节点类型改为继承正确 Node 基类的实现，或修正配置中的节点类型名。","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5cab01f7a8bee5f49f4781eebe9e2b1c6d7ebe0f","analyzedAt":"2026-08-13T21:10:40.377Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}