mirror of
https://github.com/GrahamKracker/UnityExplorer.git
synced 2025-07-03 03:52:28 +08:00
Manually get Major and Minor instead of using Version class
This commit is contained in:
@ -417,21 +417,17 @@ namespace UnityExplorer.UI
|
|||||||
AssetBundle bundle = null;
|
AssetBundle bundle = null;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// Get the Unity version (without the 'f' suffix).
|
// Get the Major and Minor of the Unity version
|
||||||
// I'm not sure if Unity always includes the 'f' suffix.
|
var split = Application.unityVersion.Split('.');
|
||||||
int len;
|
int major = int.Parse(split[0]);
|
||||||
if (Application.unityVersion.Contains("f"))
|
int minor = int.Parse(split[1]);
|
||||||
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
|
||||||
if (version.Major > 2017 || (version.Major == 2017 && version.Minor >= 3))
|
if (major > 2017 || (major == 2017 && minor >= 3))
|
||||||
bundle = LoadBundle("modern");
|
bundle = LoadBundle("modern");
|
||||||
// 5.6.0 to 2017.3
|
// 5.6.0 to 2017.3
|
||||||
else if (version.Major == 2017 || (version.Major == 5 && version.Minor >= 6))
|
else if (major == 2017 || (major == 5 && minor >= 6))
|
||||||
bundle = LoadBundle("legacy.5.6");
|
bundle = LoadBundle("legacy.5.6");
|
||||||
// < 5.6.0
|
// < 5.6.0
|
||||||
else
|
else
|
||||||
|
Reference in New Issue
Block a user