@@ -52,6 +52,7 @@ public enum VerticalAnchor
52
52
internal static GameObject PanelHolder { get ; private set ; }
53
53
54
54
internal static Font ConsoleFont { get ; private set ; }
55
+ internal static Font DefaultFont { get ; private set ; }
55
56
internal static Shader BackupShader { get ; private set ; }
56
57
57
58
public static RectTransform NavBarRect ;
@@ -92,8 +93,6 @@ internal static void InitUI()
92
93
{
93
94
LoadBundle ( ) ;
94
95
95
- UIFactory . Init ( ) ;
96
-
97
96
CreateRootCanvas ( ) ;
98
97
99
98
// Global UI Pool Holder
@@ -423,11 +422,11 @@ private static void LoadBundle()
423
422
int minor = int . Parse ( split [ 1 ] ) ;
424
423
425
424
// Use appropriate AssetBundle for Unity version
426
- // >= 2017.3
427
- if ( major > 2017 || ( major == 2017 && minor >= 3 ) )
425
+ // >= 2017
426
+ if ( major >= 2017 )
428
427
bundle = LoadBundle ( "modern" ) ;
429
- // 5.6.0 to 2017.3
430
- else if ( major == 2017 || ( major == 5 && minor >= 6 ) )
428
+ // 5.6.0 to < 2017
429
+ else if ( major == 5 && minor >= 6 )
431
430
bundle = LoadBundle ( "legacy.5.6" ) ;
432
431
// < 5.6.0
433
432
else
@@ -452,11 +451,15 @@ AssetBundle LoadBundle(string id)
452
451
{
453
452
ExplorerCore . LogWarning ( "Could not load the ExplorerUI Bundle!" ) ;
454
453
ConsoleFont = Resources . GetBuiltinResource < Font > ( "Arial.ttf" ) ;
454
+ DefaultFont = ConsoleFont ;
455
455
return ;
456
456
}
457
457
458
- BackupShader = bundle . LoadAsset < Shader > ( "DefaultUI" ) ;
458
+ // Bundle loaded
459
+ ConsoleFont = bundle . LoadAsset < Font > ( "CONSOLA" ) ;
460
+ DefaultFont = bundle . LoadAsset < Font > ( "arial" ) ;
459
461
462
+ BackupShader = bundle . LoadAsset < Shader > ( "DefaultUI" ) ;
460
463
// Fix for games which don't ship with 'UI/Default' shader.
461
464
if ( Graphic . defaultGraphicMaterial . shader ? . name != "UI/Default" )
462
465
{
@@ -466,7 +469,6 @@ AssetBundle LoadBundle(string id)
466
469
else
467
470
BackupShader = Graphic . defaultGraphicMaterial . shader ;
468
471
469
- ConsoleFont = bundle . LoadAsset < Font > ( "CONSOLA" ) ;
470
472
}
471
473
472
474
private static byte [ ] ReadFully ( Stream input )
0 commit comments