- 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.
34 lines
911 B
C#
34 lines
911 B
C#
#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>
|
||
[TaskName("Wait")]
|
||
[TaskCategory("BaseGames/Enemy/Utility")]
|
||
[TaskDescription("等待固定 Duration 秒后返回 Success")]
|
||
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
|