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.
This commit is contained in:
36
Assets/_Game/Scripts/Enemies/AI/BD_IsAiPhase.cs
Normal file
36
Assets/_Game/Scripts/Enemies/AI/BD_IsAiPhase.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
#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
|
||||
Reference in New Issue
Block a user