Task 21 Step 2 全库扫描后的收尾: 注释与 Tooltip 里的旧决策层措辞逐处改为只描述功能—— EnemyControlledState / RangedEnemy / FlyingEnemy / SensorSlotNames / EnemyPoiseComponent / EnemyAnimationConfigSO / EnemyAiBrain。 EnemyQuotaManager 的序列化字段 _maxActiveBehaviorTrees 改名 _maxActiveBrains (它裁剪的实际是 EnemyAiBrain),带 FormerlySerializedAs。复核确认目前 无任何场景 / 预制体挂载该组件,故无值可丢;属未雨绸缪。 BossSkillEventChannelSO + BossEvents.BossSkillEvent + EVT_BossSkill.asset 删除: 唯一发送方 BossSkillExecutor 已随旧轨删除,复核确认全项目零发送方、零订阅方, 资产 guid 在场景 / 预制体 / Addressables 分组中均无引用。 自检:编译 0 error;EditMode 260/260 通过; SO 校验 0 error 0 warning;层矩阵 25/25 正确。 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
59 lines
2.1 KiB
C#
59 lines
2.1 KiB
C#
using UnityEngine;
|
|
|
|
namespace BaseGames.Enemies
|
|
{
|
|
/// <summary>
|
|
/// 敌人动画配置 SO(架构 07_EnemyModule §5)。
|
|
/// 所有字段为 AnimationClip,由 Animancer 直接播放。
|
|
/// </summary>
|
|
[CreateAssetMenu(menuName = "BaseGames/Enemies/AnimationConfig")]
|
|
public class EnemyAnimationConfigSO : ScriptableObject
|
|
{
|
|
[Header("基础")]
|
|
public AnimationClip Idle;
|
|
public AnimationClip Walk;
|
|
public AnimationClip Run;
|
|
[Tooltip("转身动画(可选);配合 EnemyMovement._enableTurnAnimation 使用,留空则瞬时翻转")]
|
|
public AnimationClip Turn;
|
|
|
|
[Header("战斗")]
|
|
public AnimationClip Attack;
|
|
|
|
[Header("受击")]
|
|
public AnimationClip Hurt;
|
|
public AnimationClip Stagger;
|
|
[Tooltip("击飞腾空动画(可选);留空时由 EnemyBase.ScheduleStateRecovery 按时长自动恢复")]
|
|
public AnimationClip KnockUp;
|
|
public AnimationClip Dead;
|
|
|
|
[Header("AI 阶段")]
|
|
[Tooltip("发现目标时的短暂警觉姿态(可选)")]
|
|
public AnimationClip Alert;
|
|
[Tooltip("搜查时的慢走或环顾动作(留空则回退到 Walk)")]
|
|
public AnimationClip Investigate;
|
|
|
|
/// <summary>
|
|
/// 按字段名返回 Clip(AI 状态片段与能力模块按名取动画时使用)。
|
|
/// 支持字段名和常见别名(如 Attack_Melee / Idle 等)。
|
|
/// </summary>
|
|
public AnimationClip GetClipByName(string name)
|
|
{
|
|
return name switch
|
|
{
|
|
"Idle" => Idle,
|
|
"Walk" => Walk,
|
|
"Run" or "Chase" => Run,
|
|
"Turn" => Turn,
|
|
"Attack" or "Attack_Melee" => Attack,
|
|
"Hurt" => Hurt,
|
|
"Stagger" => Stagger,
|
|
"KnockUp" => KnockUp,
|
|
"Dead" or "Death" => Dead,
|
|
"Alert" => Alert,
|
|
"Investigate" => Investigate ?? Walk,
|
|
_ => null,
|
|
};
|
|
}
|
|
}
|
|
}
|