{"record":{"id":"a2b86a75a63125d1","repo":"egametang/ET","slug":"motiontype","errorCode":null,"errorMessage":"找不到该动作: {motionType}","messagePattern":"找不到该动作: (.+?)","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"Packages/cn.etetet.lockstep/Scripts/HotfixView/Client/LSAnimatorComponentSystem.cs","lineNumber":86,"sourceCode":"\t\t\t\tself.MotionType = MotionType.None;\n\t\t\t}\n\t\t\tcatch (Exception ex)\n\t\t\t{\n\t\t\t\tthrow new Exception($\"动作播放失败: {self.MotionType}\", ex);\n\t\t\t}\n\t\t}\n\n\t\tpublic static bool HasParameter(this LSAnimatorComponent self, string parameter)\n\t\t{\n\t\t\treturn self.Parameter.Contains(parameter);\n\t\t}\n\n\t\tpublic static void PlayInTime(this LSAnimatorComponent self, MotionType motionType, float time)\n\t\t{\n\t\t\tAnimationClip animationClip;\n\t\t\tif (!self.animationClips.TryGetValue(motionType.ToString(), out animationClip))\n\t\t\t{\n\t\t\t\tthrow new Exception($\"找不到该动作: {motionType}\");\n\t\t\t}\n\n\t\t\tfloat motionSpeed = animationClip.length / time;\n\t\t\tif (motionSpeed < 0.01f || motionSpeed > 1000f)\n\t\t\t{\n\t\t\t\tLog.Error($\"motionSpeed数值异常, {motionSpeed}, 此动作跳过\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tself.MotionType = motionType;\n\t\t\tself.MontionSpeed = motionSpeed;\n\t\t}\n\n\t\tpublic static void Play(this LSAnimatorComponent self, MotionType motionType, float motionSpeed = 1f)\n\t\t{\n\t\t\tif (!self.HasParameter(motionType.ToString()))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}","sourceCodeStart":68,"sourceCodeEnd":104,"githubUrl":"https://github.com/egametang/ET/blob/5cab01f7a8bee5f49f4781eebe9e2b1c6d7ebe0f/Packages/cn.etetet.lockstep/Scripts/HotfixView/Client/LSAnimatorComponentSystem.cs#L68-L104","documentation":"Thrown by LSAnimatorComponentSystem.PlayInTime when the requested MotionType does not have a corresponding AnimationClip in self.animationClips. The dictionary is keyed by MotionType.ToString(), so a missing entry means the clip was never registered for that motion type. The animation cannot be played in the specified time without knowing its length.","triggerScenarios":"PlayInTime is called with a MotionType that was not added to the animationClips dictionary during initialization (Awake/Init). This dictionary is typically populated by scanning the Animator's clips or by explicit registration.","commonSituations":"A new MotionType enum value was added but no AnimationClip was assigned in the prefab/inspector. The animationClips dictionary initialization did not scan all clips (e.g. clips added after Awake). PlayInTime is called before the component finished initializing its clips.","solutions":["Add an AnimationClip for the missing MotionType in the component's initialization so it populates animationClips.","Check the clip name matches the MotionType enum value exactly (the dictionary key is MotionType.ToString()).","Verify the Animator has the clip assigned and the component's clip-scanning logic runs before PlayInTime is called."],"exampleFix":"// before\npublic static void PlayInTime(this LSAnimatorComponent self, MotionType motionType, float time)\n{\n    if (!self.animationClips.TryGetValue(motionType.ToString(), out animationClip))\n        throw new Exception($\"找不到该动作: {motionType}\");\n}\n// after: guard and log\nif (!self.animationClips.TryGetValue(motionType.ToString(), out animationClip))\n{\n    Log.Warning($\"missing animation clip: {motionType}, skipping PlayInTime\");\n    return;\n}","handlingStrategy":"validation","validationCode":"// Guard before calling PlayInTime\nif (!self.animationClips.ContainsKey(motionType.ToString()))\n{\n    Log.Warning($\"No AnimationClip registered for {motionType}, cannot compute PlayInTime\");\n    return;\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Populate animationClips for every MotionType during component initialization (Awake).","Use a config or inspector-driven mapping to ensure all MotionType values have clips assigned.","Add a startup validation that checks every MotionType enum value has a clip in the dictionary."],"tags":["animation","animator","lockstep","missing-asset"],"backgroundTag":null,"analyzedSha":"5cab01f7a8bee5f49f4781eebe9e2b1c6d7ebe0f","analyzedAt":"2026-08-13T21:10:40.377Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}