Files
zeling_v2/Assets/Scripts/Enemies/AI/BD_Wait.cs
2026-05-12 15:34:08 +08:00

31 lines
771 B
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.
#if GRAPH_DESIGNER
using UnityEngine;
using Opsive.BehaviorDesigner.Runtime.Tasks;
using Opsive.BehaviorDesigner.Runtime.Tasks.Actions;
namespace BaseGames.Enemies.AI
{
/// <summary>
/// BD Action等待固定 Duration 秒后返回 Success。
/// 适用于攻击前摇、冷却间隔等固定等待。
/// </summary>
public class BD_Wait : Action
{
[UnityEngine.SerializeField] private float m_Duration = 1f;
private float _elapsed;
public override void OnStart()
{
_elapsed = 0f;
}
public override TaskStatus OnUpdate()
{
_elapsed += Time.deltaTime;
return _elapsed >= m_Duration ? TaskStatus.Success : TaskStatus.Running;
}
}
}
#endif