mirror of
https://github.com/sinai-dev/UnityExplorer.git
synced 2025-06-17 22:48:04 +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;
|
AssetBundle bundle = null;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// Get the Unity version (without the 'f_' suffix).
|
// Get the Unity version (without the 'f' suffix).
|
||||||
Version version = new Version(Application.unityVersion.Substring(0, Application.unityVersion.LastIndexOf('f')));
|
// 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
|
// Use appropriate AssetBundle for Unity version
|
||||||
// >= 2017.3
|
// >= 2017.3
|
||||||
|
Loading…
x
Reference in New Issue
Block a user