地图系统

This commit is contained in:
2026-06-05 18:41:33 +08:00
parent 613f2a4d13
commit fe4fd60083
234 changed files with 33090 additions and 4899 deletions

View File

@@ -5,6 +5,7 @@ using UnityEngine.AddressableAssets;
using UnityEngine.ResourceManagement.AsyncOperations;
using UnityEngine.ResourceManagement.ResourceProviders;
using UnityEngine.SceneManagement;
using BaseGames.Core.Assets;
namespace BaseGames.World.Streaming
{
@@ -74,7 +75,7 @@ namespace BaseGames.World.Streaming
State = RoomState.Loading;
_sceneHandle = Addressables.LoadSceneAsync(addressableKey, LoadSceneMode.Additive);
_sceneHandle = AssetLoader.LoadSceneAsync(addressableKey, LoadSceneMode.Additive);
while (!_sceneHandle.IsDone)
yield return null;
@@ -112,7 +113,7 @@ namespace BaseGames.World.Streaming
State = RoomState.Unloading;
var op = Addressables.UnloadSceneAsync(_sceneHandle);
var op = AssetLoader.UnloadSceneAsync(_sceneHandle);
yield return op;
_renderers = null;

View File

@@ -77,9 +77,9 @@ namespace BaseGames.World.Streaming
{
var graph = new WorldGraph(unitsPerGrid);
if (database == null || database.AllRooms == null)
if (database == null || database.AllRooms == null || database.AllRooms.Length == 0)
{
Debug.LogError("[WorldGraph] MapDatabaseSO 为空,无法构建世界图。");
Debug.LogWarning("[WorldGraph] MapDatabaseSO 为空或无房间数据,跳过世界图构建(新建项目正常)。");
return graph;
}