refactor(enemy): Appear/FacePlayer/PlayClip 参数迁入各自子类 SO
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user