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:
2026-05-23 19:10:29 +08:00
parent 81c326af53
commit a1b4e629aa
165 changed files with 7904 additions and 313 deletions

View File

@@ -1,4 +1,4 @@
#if GRAPH_DESIGNER
#if GRAPH_DESIGNER
using UnityEngine;
using Opsive.BehaviorDesigner.Runtime.Tasks;
using Opsive.BehaviorDesigner.Runtime.Tasks.Actions;
@@ -10,6 +10,9 @@ namespace BaseGames.Enemies.AI
/// BD Action触发攻击预警TelegraphSystem等待 Duration 秒后返回 Success。
/// 对应架构 07_EnemyModule §8 BD_TelegraphAttack与 TelegraphSystem 协作。
/// </summary>
[TaskName("Telegraph Attack")]
[TaskCategory("BaseGames/Enemy/Combat")]
[TaskDescription("播放攻击前摇动画并等待结束后返回 Success")]
public class BD_TelegraphAttack : Action
{
[SerializeField] private float m_Duration = 1f;
@@ -17,15 +20,18 @@ namespace BaseGames.Enemies.AI
private TelegraphSystem _telegraph;
private float _elapsed;
private Coroutine _telegraphCoroutine;
public override void OnAwake() => _telegraph = GetComponent<TelegraphSystem>();
public override void OnStart()
{
_telegraph = GetComponent<TelegraphSystem>();
_elapsed = 0f;
_elapsed = 0f;
_telegraphCoroutine = null;
if (_telegraph != null && !string.IsNullOrEmpty(m_VfxKey))
{
_telegraph.StartCoroutine(
_telegraphCoroutine = _telegraph.StartCoroutine(
_telegraph.ShowTelegraph(m_VfxKey, m_Duration, transform.position));
}
}
@@ -35,6 +41,16 @@ namespace BaseGames.Enemies.AI
_elapsed += Time.deltaTime;
return _elapsed >= m_Duration ? TaskStatus.Success : TaskStatus.Running;
}
public override void OnEnd()
{
// BD 任务被 Abort 时停止仍在播放的预警协程,避免孤立 VFX
if (_telegraphCoroutine != null)
{
_telegraph?.StopCoroutine(_telegraphCoroutine);
_telegraphCoroutine = null;
}
}
}
}
#endif