Skip to content
This repository was archived by the owner on May 9, 2023. It is now read-only.

Commit dfd5526

Browse files
committed
Fallback to null check loading if unityVersion throws an exception
1 parent 29c78dc commit dfd5526

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/UI/UIManager.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ private static void CreateTopNavBar()
414414

415415
private static void LoadBundle()
416416
{
417-
AssetBundle bundle = null;
417+
AssetBundle bundle;
418418
try
419419
{
420420
// Get the Major and Minor of the Unity version
@@ -433,10 +433,10 @@ private static void LoadBundle()
433433
else
434434
bundle = LoadBundle("legacy");
435435
}
436-
catch (Exception ex)
436+
catch
437437
{
438-
ExplorerCore.LogWarning($"Exception loading Explorer AssetBundle!");
439-
ExplorerCore.Log(ex);
438+
ExplorerCore.LogWarning($"Exception parsing Unity version, falling back to old AssetBundle load method...");
439+
bundle = LoadBundle("modern") ?? LoadBundle("legacy.5.6") ?? LoadBundle("legacy");
440440
}
441441

442442
AssetBundle LoadBundle(string id)

0 commit comments

Comments
 (0)