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:
@@ -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 ||
|
||||
|
||||
Reference in New Issue
Block a user