Files
zeling_v2/Assets/_Game/Scripts/Enemies/E004_ZhiMu.cs

46 lines
1.2 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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();
}
}
}