feat(enemy): EnemyLocomotion 按模式驱动步态动画(Idle/Walk/Alert/Run)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user