mirror of
https://github.com/sinai-dev/UnityExplorer.git
synced 2025-01-05 17:13:43 +08:00
Handle cases where Unity doesn't include 'f' suffix on version
Not sure if this ever happens but just in case
This commit is contained in:
parent
bb0c59534a
commit
bf59d9d6cd
@ -417,8 +417,14 @@ namespace UnityExplorer.UI
|
||||
AssetBundle bundle = null;
|
||||
try
|
||||
{
|
||||
// Get the Unity version (without the 'f_' suffix).
|
||||
Version version = new Version(Application.unityVersion.Substring(0, Application.unityVersion.LastIndexOf('f')));
|
||||
// Get the Unity version (without the 'f' suffix).
|
||||
// I'm not sure if Unity always includes the 'f' suffix.
|
||||
int len;
|
||||
if (Application.unityVersion.Contains("f"))
|
||||
len = Application.unityVersion.LastIndexOf("f");
|
||||
else
|
||||
len = Application.unityVersion.Length;
|
||||
Version version = new Version(Application.unityVersion.Substring(0, len));
|
||||
|
||||
// Use appropriate AssetBundle for Unity version
|
||||
// >= 2017.3
|
||||
|
Loading…
x
Reference in New Issue
Block a user