Add enemy respawner and related components for room lifecycle management

- Implemented EnemyRespawner to manage enemy spawning and respawning within rooms.
- Added IRoomLifecycle interface for room activation and dormancy handling.
- Created supporting classes and metadata for enemy perception and threat assessment.
- Established streaming system components for room state management and transitions.
- Added necessary metadata files for new scripts to ensure proper integration with Unity.
This commit is contained in:
2026-05-23 21:23:09 +08:00
parent a1b4e629aa
commit 520f84999b
34 changed files with 1710 additions and 63 deletions

View File

@@ -96,6 +96,13 @@ namespace BaseGames.World.Streaming
{
if (State == RoomState.Unloaded || State == RoomState.Unloading || !_sceneHandle.IsValid()) yield break;
// 若正处于加载中等待加载完成后再卸载Addressables 不支持对未完成的句柄直接卸载)
if (State == RoomState.Loading)
{
while (!_sceneHandle.IsDone)
yield return null;
}
// Active 状态先走 Deactivate再设置 Unloading
bool needsDeactivate = State == RoomState.Active ||
State == RoomState.Activating ||