mirror of
https://github.com/GrahamKracker/UnityExplorer.git
synced 2025-07-01 19:13:03 +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:
@ -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
|
||||||
|
Reference in New Issue
Block a user