Files
zeling_v2/Assets/_Game/Scripts/Enemies/AI/BD_IsAiPhase.cs
T
joywayer a1b4e629aa feat: Implement Room Streaming System
- Add RoomStreamingManager to manage room loading and unloading based on player proximity.
- Create StreamingBudgetConfigSO for memory and performance budgeting of the streaming system.
- Introduce TransitionDirector to handle seamless and atmospheric fade transitions between rooms.
- Develop WorldGraph to represent room connectivity and facilitate neighbor queries and distance calculations.
- Implement RoomNode and RoomEdge classes to structure room data and connections.
2026-05-23 19:10:29 +08:00

37 lines
1.2 KiB
C#

#if GRAPH_DESIGNER
using UnityEngine;
using Opsive.BehaviorDesigner.Runtime.Tasks;
using Opsive.BehaviorDesigner.Runtime.Tasks.Conditionals;
using BaseGames.Enemies;
namespace BaseGames.Enemies.AI
{
/// <summary>
/// BD Conditional:当前 AI 行为阶段是否与目标匹配。
///
/// 常用于 Decorator Conditional Abort 或 Sequence 头部保护子树,
/// 例如只有在 <see cref="AiPhase.Patrol"/> 阶段时才执行巡逻序列。
/// </summary>
[TaskName("Is Ai Phase?")]
[TaskCategory("BaseGames/Enemy/State")]
[TaskDescription("检查当前 AI 行为阶段是否与目标枚举值匹配")]
public sealed class BD_IsAiPhase : Conditional
{
[Tooltip("目标 AI 行为阶段")]
[SerializeField] private AiPhase m_Phase = AiPhase.Patrol;
private EnemyBase _enemy;
public override void OnAwake() => _enemy = gameObject.GetComponent<EnemyBase>();
public override TaskStatus OnUpdate()
{
if (_enemy == null) return TaskStatus.Failure;
return _enemy.CurrentAiPhase == m_Phase
? TaskStatus.Success
: TaskStatus.Failure;
}
}
}
#endif