From dfd55260a84c087d20248988f54af98b61d8d4bb Mon Sep 17 00:00:00 2001 From: Sinai Date: Thu, 15 Jul 2021 05:19:48 +1000 Subject: [PATCH] Fallback to null check loading if unityVersion throws an exception --- src/UI/UIManager.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/UI/UIManager.cs b/src/UI/UIManager.cs index 32009a2..7877ed2 100644 --- a/src/UI/UIManager.cs +++ b/src/UI/UIManager.cs @@ -414,7 +414,7 @@ namespace UnityExplorer.UI private static void LoadBundle() { - AssetBundle bundle = null; + AssetBundle bundle; try { // Get the Major and Minor of the Unity version @@ -433,10 +433,10 @@ namespace UnityExplorer.UI else bundle = LoadBundle("legacy"); } - catch (Exception ex) + catch { - ExplorerCore.LogWarning($"Exception loading Explorer AssetBundle!"); - ExplorerCore.Log(ex); + ExplorerCore.LogWarning($"Exception parsing Unity version, falling back to old AssetBundle load method..."); + bundle = LoadBundle("modern") ?? LoadBundle("legacy.5.6") ?? LoadBundle("legacy"); } AssetBundle LoadBundle(string id)