feat(enemy): EnemyLocomotion 按模式驱动步态动画(Idle/Walk/Alert/Run)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-07-10 13:33:16 +08:00
co-authored by Claude Opus 4.8
parent 087aa96ca6
commit 347d0e2f50
2 changed files with 23 additions and 0 deletions
+15
View File
@@ -487,6 +487,21 @@ namespace BaseGames.Enemies
}
}
/// <summary>按当前移动模式播放步态动画(由 EnemyLocomotion 在模式变化时调用)。</summary>
public void PlayLocomotionClip(LocomotionMode mode)
{
if (_animancer == null || _animConfig == null) return;
var clip = mode switch
{
LocomotionMode.Idle => _animConfig.Idle,
LocomotionMode.Patrol => _animConfig.Walk,
LocomotionMode.Face => _animConfig.Alert,
LocomotionMode.Approach => _animConfig.Run,
_ => null,
};
if (clip != null) _animancer.Play(clip);
}
// ── 动画事件钩子(由 EnemyAnimationEvents 调用)────────────────────
/// <summary>