joywayer 5046125acb docs(enemy): 执行须知第 5 条——RequireComponent 指向抽象类型时 AddComponent 返回 null
HurtBox 标了 [RequireComponent(typeof(Collider2D))],Collider2D 是抽象类,
Unity 无法自动补齐,AddComponent<HurtBox>() 返回真 null。建测试对象须先挂
具体碰撞体。Task 6 实测证实;HurtBoxEditor.cs:97 早有同样注释,说明这个坑
项目里踩过但没写进规范。
2026-07-30 14:04:42 +08:00
2026-07-20 10:33:18 +08:00
2026-07-20 10:33:18 +08:00
2026-05-08 11:04:00 +08:00
@
2026-07-10 11:37:16 +08:00
@
2026-07-10 11:37:16 +08:00
2026-07-20 10:33:18 +08:00
2026-07-20 10:33:18 +08:00
2026-05-22 13:25:40 +08:00
2026-07-21 10:22:43 +08:00
2026-07-28 13:18:41 +08:00
S
Description
No description provided
209 MiB
Languages
C# 85.5%
GLSL 12.4%
ShaderLab 1.9%
HLSL 0.1%