46 lines
1.2 KiB
C#
46 lines
1.2 KiB
C#
using System.Collections;
|
||
using Animancer;
|
||
using BaseGames.Combat;
|
||
using UnityEngine;
|
||
|
||
namespace BaseGames.Enemies
|
||
{
|
||
/// <summary>
|
||
/// E004 蛭母(小Boss)。
|
||
/// 特性:
|
||
/// - 出场演出(AppearAbility)
|
||
/// - 三技能(撕咬/头槌/酸液)+ 翻身(FacePlayerAbility)
|
||
/// - 死亡两阶段:Death_Pre 无敌演出 → base.Die()
|
||
/// </summary>
|
||
public class E004_ZhiMu : EnemyBase
|
||
{
|
||
[Header("死亡演出")]
|
||
[SerializeField] private ClipTransition _deathPreClip;
|
||
[SerializeField] private HurtBox _hurtBox;
|
||
[SerializeField] private float _deathPreDuration = 3f;
|
||
|
||
protected override void Die()
|
||
{
|
||
StartCoroutine(DeathSequence());
|
||
}
|
||
|
||
private IEnumerator DeathSequence()
|
||
{
|
||
// 停止行为树防止覆盖演出动画
|
||
StopBehaviorTree();
|
||
StopMovement();
|
||
|
||
if (_hurtBox != null)
|
||
_hurtBox.enabled = false;
|
||
|
||
if (_deathPreClip.Clip != null)
|
||
{
|
||
Animancer.Play(_deathPreClip);
|
||
yield return new WaitForSeconds(_deathPreDuration);
|
||
}
|
||
|
||
base.Die();
|
||
}
|
||
}
|
||
}
|