fix(enemy): MeleeAttackAbility 空 clip 走 fallbackDuration(判 clip.Clip 而非 clip),兑现 EnemyAttackSO 契约
This commit is contained in:
@@ -68,7 +68,9 @@ namespace BaseGames.Enemies.Abilities
|
||||
Phase = AbilityRunState.Active;
|
||||
|
||||
float duration = atk.fallbackDuration;
|
||||
if (atk.clip != null && _animancer != null)
|
||||
// clip 是 ClipTransition(包装对象,恒非 null);须判其内部 .Clip 是否为空——
|
||||
// 为空表示本段无动画,按 EnemyAttackSO 契约走 fallbackDuration,不可 Play(否则 Animancer 抛 Clip is null)。
|
||||
if (atk.clip != null && atk.clip.Clip != null && _animancer != null)
|
||||
{
|
||||
var state = _animancer.Play(atk.clip);
|
||||
if (state != null && state.Length > 0f) duration = state.Length;
|
||||
|
||||
Reference in New Issue
Block a user