This repository was archived by the owner on May 9, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +6
-10
lines changed Expand file tree Collapse file tree 1 file changed +6
-10
lines changed Original file line number Diff line number Diff line change @@ -417,21 +417,17 @@ private static void LoadBundle()
417
417
AssetBundle bundle = null ;
418
418
try
419
419
{
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 ) ) ;
420
+ // Get the Major and Minor of the Unity version
421
+ var split = Application . unityVersion . Split ( '.' ) ;
422
+ int major = int . Parse ( split [ 0 ] ) ;
423
+ int minor = int . Parse ( split [ 1 ] ) ;
428
424
429
425
// Use appropriate AssetBundle for Unity version
430
426
// >= 2017.3
431
- if ( version . Major > 2017 || ( version . Major == 2017 && version . Minor >= 3 ) )
427
+ if ( major > 2017 || ( major == 2017 && minor >= 3 ) )
432
428
bundle = LoadBundle ( "modern" ) ;
433
429
// 5.6.0 to 2017.3
434
- else if ( version . Major == 2017 || ( version . Major == 5 && version . Minor >= 6 ) )
430
+ else if ( major == 2017 || ( major == 5 && minor >= 6 ) )
435
431
bundle = LoadBundle ( "legacy.5.6" ) ;
436
432
// < 5.6.0
437
433
else
You can’t perform that action at this time.
0 commit comments