- 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.
29 lines
958 B
C#
29 lines
958 B
C#
#if GRAPH_DESIGNER
|
||
using Opsive.BehaviorDesigner.Runtime.Tasks;
|
||
using Opsive.BehaviorDesigner.Runtime.Tasks.Conditionals;
|
||
using BaseGames.Enemies;
|
||
|
||
namespace BaseGames.Enemies.AI
|
||
{
|
||
/// <summary>
|
||
/// BD Conditional:敌人是否靠近平台边缘。
|
||
/// 通过 EnemyNavAgent.IsNearEdge() 检测(双射线检测脚下/前方地面)。
|
||
/// </summary>
|
||
[TaskName("Is Near Edge?")]
|
||
[TaskCategory("BaseGames/Enemy/State")]
|
||
[TaskDescription("检查前方是否有悬崖边缘(基于 SensorToolkit 或 Raycast)")]
|
||
public class BD_IsNearEdge : Conditional
|
||
{
|
||
private EnemyBase _enemy;
|
||
|
||
public override void OnAwake() => _enemy = GetComponent<EnemyBase>();
|
||
|
||
public override TaskStatus OnUpdate()
|
||
{
|
||
if (_enemy == null || _enemy.Nav == null) return TaskStatus.Failure;
|
||
return _enemy.Nav.IsNearEdge() ? TaskStatus.Success : TaskStatus.Failure;
|
||
}
|
||
}
|
||
}
|
||
#endif
|