mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-10-09 00:26:11 +00:00
提交
This commit is contained in:
@@ -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
|
||||
// }
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user