refactor(enemy): Appear/FacePlayer/PlayClip 参数迁入各自子类 SO

This commit is contained in:
2026-07-21 11:35:39 +08:00
parent 78c8c6dcd6
commit 6d071e83ae
9 changed files with 99 additions and 12 deletions
@@ -10,15 +10,21 @@ namespace BaseGames.Enemies.Abilities
/// </summary>
public class AppearAbility : EnemyAbilityBase
{
[SerializeField] private ClipTransition _appearClip;
private AppearAbilitySO _cfg;
protected override void Awake()
{
base.Awake();
_cfg = ResolveConfig<AppearAbilitySO>();
}
protected override IEnumerator ExecuteCoroutine()
{
Phase = AbilityRunState.Active;
if (_appearClip.Clip == null) yield break;
if (_cfg == null || _cfg.appearClip.Clip == null) yield break;
_animancer.Play(_appearClip);
yield return EnemyAbilityWaits.Get(_appearClip.Clip.length);
_animancer.Play(_cfg.appearClip);
yield return EnemyAbilityWaits.Get(_cfg.appearClip.Clip.length);
}
}
}