This commit is contained in:
PC-20230316NUNE\Administrator
2024-01-30 19:22:27 +08:00
parent 09db51f67b
commit a0c687b1ed
114 changed files with 18393 additions and 13605 deletions

View File

@@ -55,6 +55,7 @@ namespace Script.battle
public async UniTask OnReset()
{
await this.UnloadScene();
await UniTask.NextFrame();
App.Sync.OnReset();
await this.LoadScene();
_current = GBattleMode.Not;
@@ -72,7 +73,7 @@ namespace Script.battle
GBattleMode mode = this._current;
if (mode == GBattleMode.Not) return;
Debug.Log($"[GBattleModeManager] 打开场景{GetWorldName(mode)}");
await SceneManager.LoadSceneAsync(GetWorldName(mode), LoadSceneMode.Additive);
await SceneManager.LoadSceneAsync(GetWorldName(mode));
}
//销毁所有场景
@@ -80,17 +81,19 @@ namespace Script.battle
{
Debug.Log($"[GBattleModeManager] 关闭场景");
foreach (var world in Worlds)
{
try
{
await SceneManager.UnloadSceneAsync(world);
}
catch
{
// ignored
}
}
await UniTask.NextFrame();
//
// for (int i = SceneManager.sceneCount - 1; i >= 0; i--)
// {
// try
// {
// await SceneManager.UnloadSceneAsync(SceneManager.GetSceneAt(i));
// }
// catch
// {
// // ignored
// }
// }
}