Skip to content

Commit 66cc96a

Browse files
committed
💫 修复 场景加载失败
1 parent c26b537 commit 66cc96a

File tree

1 file changed

+4
-50
lines changed

1 file changed

+4
-50
lines changed

Extensions/YooAsset.CLI/Runtime/1.5.7/Load/Load.Scene.cs

Lines changed: 4 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -35,34 +35,8 @@ public override IEnumerator LoadSceneCO(
3535
var operation = HandleGet<SceneOperationHandle>(location);
3636
if (operation != null)
3737
{
38-
switch (operation.Status)
39-
{
40-
case EOperationStatus.Processing:
41-
yield return LoadCheckOPCo(operation, succeed =>
42-
{
43-
if (succeed)
44-
{
45-
operation.ActivateScene();
46-
cb?.Invoke(operation.SceneObject);
47-
}
48-
else
49-
{
50-
AssetSystem.LogException($"场景配置 异常错误 : {location} {sceneMode}");
51-
cb?.Invoke(SceneManager.GetActiveScene());
52-
}
53-
});
54-
yield break;
55-
case EOperationStatus.Succeed:
56-
operation.ActivateScene();
57-
cb?.Invoke(operation.SceneObject);
58-
yield break;
59-
default:
60-
case EOperationStatus.None:
61-
case EOperationStatus.Failed:
62-
yield return operation.UnloadAsync();
63-
HandleFree(location);
64-
break;
65-
}
38+
yield return operation.UnloadAsync();
39+
HandleFree(location);
6640
}
6741

6842
ResPackage package = null;
@@ -102,28 +76,8 @@ public override async Task<Scene> LoadSceneTask(
10276
var operation = HandleGet<SceneOperationHandle>(location);
10377
if (operation != null)
10478
{
105-
switch (operation.Status)
106-
{
107-
case EOperationStatus.Processing:
108-
if (await LoadCheckOPTask(operation))
109-
{
110-
operation.ActivateScene();
111-
return operation.SceneObject;
112-
}
113-
114-
AssetSystem.LogException($"场景配置 异常错误 : {location} {sceneMode}");
115-
return SceneManager.GetActiveScene();
116-
117-
case EOperationStatus.Succeed:
118-
operation.ActivateScene();
119-
return operation.SceneObject;
120-
default:
121-
case EOperationStatus.None:
122-
case EOperationStatus.Failed:
123-
await operation.UnloadAsync().Task;
124-
HandleFree(location);
125-
break;
126-
}
79+
await operation.UnloadAsync().Task;
80+
HandleFree(location);
12781
}
12882

12983
var package = await GetAutoPackageTask(location);

0 commit comments

Comments
 (0)