- 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.
25 lines
971 B
C#
25 lines
971 B
C#
namespace BaseGames.World
|
||
{
|
||
/// <summary>
|
||
/// 实现此接口的组件可感知房间的 Dormant / Active 生命周期切换。
|
||
/// <para>
|
||
/// <see cref="Streaming.RoomHandle"/> 在休眠或激活房间时,
|
||
/// 会调用场景内所有实现了此接口的组件,使其做出相应响应(关闭 AI、保存状态等)。
|
||
/// </para>
|
||
/// </summary>
|
||
public interface IRoomLifecycle
|
||
{
|
||
/// <summary>
|
||
/// 房间进入休眠时调用。实现方应关闭 AI、暂停动画、停止音效,
|
||
/// 以避免 Dormant 房间消耗不必要的 CPU。
|
||
/// </summary>
|
||
void OnRoomDormant();
|
||
|
||
/// <summary>
|
||
/// 房间被激活时调用。实现方应恢复 AI、重置状态、播放入场效果等。
|
||
/// </summary>
|
||
/// <param name="context">出生上下文,含出生点 ID 和是否为复活流程。</param>
|
||
void OnRoomActivate(SpawnContext context);
|
||
}
|
||
}
|