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

Commit bf59d9d

Browse files
committed
Handle cases where Unity doesn't include 'f' suffix on version
Not sure if this ever happens but just in case
1 parent bb0c595 commit bf59d9d

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/UI/UIManager.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -417,8 +417,14 @@ private static void LoadBundle()
417417
AssetBundle bundle = null;
418418
try
419419
{
420-
// Get the Unity version (without the 'f_' suffix).
421-
Version version = new Version(Application.unityVersion.Substring(0, Application.unityVersion.LastIndexOf('f')));
420+
// Get the Unity version (without the 'f' suffix).
421+
// I'm not sure if Unity always includes the 'f' suffix.
422+
int len;
423+
if (Application.unityVersion.Contains("f"))
424+
len = Application.unityVersion.LastIndexOf("f");
425+
else
426+
len = Application.unityVersion.Length;
427+
Version version = new Version(Application.unityVersion.Substring(0, len));
422428

423429
// Use appropriate AssetBundle for Unity version
424430
// >= 2017.3

0 commit comments

Comments
 (0)