refactor(enemy): Appear/FacePlayer/PlayClip 参数迁入各自子类 SO
This commit is contained in:
@@ -10,15 +10,21 @@ namespace BaseGames.Enemies.Abilities
|
||||
/// </summary>
|
||||
public class PlayClipAbility : EnemyAbilityBase
|
||||
{
|
||||
[SerializeField] private ClipTransition _clip;
|
||||
private PlayClipAbilitySO _cfg;
|
||||
|
||||
protected override void Awake()
|
||||
{
|
||||
base.Awake();
|
||||
_cfg = ResolveConfig<PlayClipAbilitySO>();
|
||||
}
|
||||
|
||||
protected override IEnumerator ExecuteCoroutine()
|
||||
{
|
||||
Phase = AbilityRunState.Active;
|
||||
if (_clip.Clip == null) yield break;
|
||||
if (_cfg == null || _cfg.clip.Clip == null) yield break;
|
||||
|
||||
_animancer.Play(_clip);
|
||||
yield return EnemyAbilityWaits.Get(_clip.Clip.length);
|
||||
_animancer.Play(_cfg.clip);
|
||||
yield return EnemyAbilityWaits.Get(_cfg.clip.Clip.length);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user