refactor(ai): E001 贯彻"AI只决策"——每状态=一能力(Model A)

AI 决策层(E001CaoZhiAi + PerceptionStateMachine)彻底移除所有 actuation:
不再有 Mover.Stop/FacePlayer/UseChaseSpeed/WalkRandom、也不再 SetPhase。
每个 AI 状态只声明触发哪个能力 id,行为(移动/朝向/停/速度/动画/伤害/
阶段声明)全部下沉到对应能力里。

- 新增 IdleAbility/PatrolAbility/AlertAbility:待机静止、巡逻游走、
  警觉朝向玩家,各自 SetAiPhase 驱动阶段动画。
- ContactChaseAbility 追击进入时自设 RunSpeed + Chase 阶段(原在 AI)。
- PerceptionStateMachine 改为 AddAbilityState:进入/每帧 EnsureAbility
  (被打断/受击后自动重触发)、离开 InterruptAbilities;转换规则不变。
- IEnemyActor/EnemyBrainContext 移除已无用的 SetPhase,保留 HasAlertState。
- 新增 SO:ABL_E001_Idle(e001_idle)、ABL_E001_Patrol(e001_patrol)。
- 脚手架 PlaceE001 与 ENM_CaoZhi 预制体同步为四能力结构;TestRoomA
  实例替换为规范预制体实例。

PlayMode 验证:Chase→ContactChaseAbility、脱离感知→Move_Patrol→
PatrolAbility,阶段由能力设置,无报错。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-07-10 10:05:14 +08:00
co-authored by Claude Opus 4.8
parent 490329e1dc
commit 2e2df2b5dd
18 changed files with 464 additions and 943 deletions
@@ -0,0 +1,27 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 9050afa76362dff469c64fbb48c9ff8d, type: 3}
m_Name: ABL_E001_Idle
m_EditorClassIdentifier:
abilityId: e001_idle
attackSequence: []
cooldown: 0
telegraphVfxKey:
telegraphDuration: 0
interruptOnHurt: 1
interruptOnStagger: 1
preferredMinRange: 0
preferredMaxRange: 5
requiresLineOfSight: 0
requiresGrounded: 1
exclusionGroup:
priority: 0
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 39972ac36f68c5a40a696350ee5b45ef
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,27 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 9050afa76362dff469c64fbb48c9ff8d, type: 3}
m_Name: ABL_E001_Patrol
m_EditorClassIdentifier:
abilityId: e001_patrol
attackSequence: []
cooldown: 0
telegraphVfxKey:
telegraphDuration: 0
interruptOnHurt: 1
interruptOnStagger: 1
preferredMinRange: 0
preferredMaxRange: 5
requiresLineOfSight: 0
requiresGrounded: 1
exclusionGroup:
priority: 0
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: ea84fa0bad3eb9c44841fbe355923cbd
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant: