refactor(enemy): 身体接触伤害改为常驻开启并与能力解耦
所有敌人默认常驻身体接触伤害:存活即开、死亡时经 PerformDeath 统一关碰撞体停止。 - ContactChaseAbility/AnimatedCeilingDropAbility 移除对 BodyContactDamage 的开关引用 - BodyContactDamage 语义改为常驻(更新注释) - 脚手架 SetupHurtAndContactBoxes 去掉 contactEnabled 参数恒为 true,并把 ContactDamageZone 的 HitBox._targetLayers 限定为 PlayerHurtBox(避免常驻后敌人互相误伤) - 7 个敌人预制体:E001 启用 BodyContactDamage;E002/E004/E005/ChaoFeng 补齐 ContactDamageZone(镜像 HurtBox 身体碰撞体);全部 _targetLayers 收敛为 PlayerHurtBox - 更新 Docs/Guides/02 敌人搭建指南 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -204,7 +204,7 @@ ENM_CaoZhi (根节点)
|
||||
├── HurtBox/
|
||||
│ ├── 组件:HurtBox、Collider2D(Is Trigger=true, Layer=EnemyHurtBox)
|
||||
├── ContactDamageZone/
|
||||
│ ├── 组件:BodyContactDamage、HitBox、Collider2D(Is Trigger=true, Layer=EnemyHitBox)
|
||||
│ ├── 组件:BodyContactDamage(默认常驻 enabled=true)、HitBox、Collider2D(Is Trigger=true, Layer=EnemyHitBox)
|
||||
└── Abilities/
|
||||
├── 子节点 Activate_Ability → 组件:PlayClipAbility
|
||||
└── 子节点 Chase_Ability → 组件:ContactChaseAbility
|
||||
@@ -235,7 +235,6 @@ ENM_CaoZhi (根节点)
|
||||
- `_config`:拖入 `ABL_E001_Chase.asset`
|
||||
- `_loopClip`:`Skill_Loop.anim`
|
||||
- `_endClip`:`Skill_End.anim`
|
||||
- `_contactDamage`:拖入 `ContactDamageZone/` 节点上的 `BodyContactDamage` 组件
|
||||
- `_sensorHub`:拖入根节点上的 `EnemySensorHub` 组件
|
||||
- `_aggroSlotName`:`"aggro"`
|
||||
|
||||
@@ -409,7 +408,7 @@ ENM_YouZhi (根节点)
|
||||
├── 组件:Rigidbody2D(初始 Body Type=Kinematic,下落能力会自动切换为 Dynamic)
|
||||
├── HurtBox/
|
||||
├── ContactDamageZone/
|
||||
│ └── 组件:BodyContactDamage(初始 enabled=false,落地后由能力自动启用)
|
||||
│ └── 组件:BodyContactDamage(默认常驻 enabled=true;存活即身体接触伤害,与能力解耦,死亡时经 PerformDeath 统一关碰撞体停止)
|
||||
└── Abilities/
|
||||
└── 子节点 Fall_Ability → 组件:AnimatedCeilingDropAbility
|
||||
```
|
||||
@@ -424,7 +423,6 @@ ENM_YouZhi (根节点)
|
||||
| `_maxFallTime` | `3`(超时保护) |
|
||||
| `_groundMask` | 选择 `Ground` Layer |
|
||||
| `_recoveryTime` | `0.1`(落地后短暂停顿) |
|
||||
| `_contactDamage` | 拖入 `ContactDamageZone/` 的 BodyContactDamage |
|
||||
|
||||
**EnemyAbilityTrigger 组件配置**(零代码出生/触发执行能力,替代过去的 E003_YouZhi 专属脚本):
|
||||
- `_abilityId`:`e003_fall`(与 `ABL_E003_Fall.asset` 的 `abilityId` 一致)
|
||||
|
||||
Reference in New Issue
Block a user