- 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.
37 lines
1.1 KiB
C#
37 lines
1.1 KiB
C#
#if GRAPH_DESIGNER
|
|
using UnityEngine;
|
|
using Opsive.BehaviorDesigner.Runtime.Tasks;
|
|
using Opsive.BehaviorDesigner.Runtime.Tasks.Actions;
|
|
|
|
namespace BaseGames.Enemies.AI
|
|
{
|
|
/// <summary>
|
|
/// BD Action:在 [Min, Max] 范围内随机等待后返回 Success。
|
|
/// 适用于巡逻间隔、随机攻击延迟等自然行为。
|
|
/// </summary>
|
|
[TaskName("Wait (Random)")]
|
|
[TaskCategory("BaseGames/Enemy/Utility")]
|
|
[TaskDescription("在 Min~Max 范围内随机等待后返回 Success")]
|
|
public class BD_WaitRandom : Action
|
|
{
|
|
[UnityEngine.SerializeField] private float m_Min = 0.5f;
|
|
[UnityEngine.SerializeField] private float m_Max = 2.0f;
|
|
|
|
private float _elapsed;
|
|
private float _target;
|
|
|
|
public override void OnStart()
|
|
{
|
|
_elapsed = 0f;
|
|
_target = Random.Range(m_Min, m_Max);
|
|
}
|
|
|
|
public override TaskStatus OnUpdate()
|
|
{
|
|
_elapsed += Time.deltaTime;
|
|
return _elapsed >= _target ? TaskStatus.Success : TaskStatus.Running;
|
|
}
|
|
}
|
|
}
|
|
#endif
|