@@ -52,6 +52,7 @@ public enum VerticalAnchor
5252 internal static GameObject PanelHolder { get ; private set ; }
5353
5454 internal static Font ConsoleFont { get ; private set ; }
55+ internal static Font DefaultFont { get ; private set ; }
5556 internal static Shader BackupShader { get ; private set ; }
5657
5758 public static RectTransform NavBarRect ;
@@ -92,8 +93,6 @@ internal static void InitUI()
9293 {
9394 LoadBundle ( ) ;
9495
95- UIFactory . Init ( ) ;
96-
9796 CreateRootCanvas ( ) ;
9897
9998 // Global UI Pool Holder
@@ -423,11 +422,11 @@ private static void LoadBundle()
423422 int minor = int . Parse ( split [ 1 ] ) ;
424423
425424 // Use appropriate AssetBundle for Unity version
426- // >= 2017.3
427- if ( major > 2017 || ( major == 2017 && minor >= 3 ) )
425+ // >= 2017
426+ if ( major >= 2017 )
428427 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 )
431430 bundle = LoadBundle ( "legacy.5.6" ) ;
432431 // < 5.6.0
433432 else
@@ -452,11 +451,15 @@ AssetBundle LoadBundle(string id)
452451 {
453452 ExplorerCore . LogWarning ( "Could not load the ExplorerUI Bundle!" ) ;
454453 ConsoleFont = Resources . GetBuiltinResource < Font > ( "Arial.ttf" ) ;
454+ DefaultFont = ConsoleFont ;
455455 return ;
456456 }
457457
458- BackupShader = bundle . LoadAsset < Shader > ( "DefaultUI" ) ;
458+ // Bundle loaded
459+ ConsoleFont = bundle . LoadAsset < Font > ( "CONSOLA" ) ;
460+ DefaultFont = bundle . LoadAsset < Font > ( "arial" ) ;
459461
462+ BackupShader = bundle . LoadAsset < Shader > ( "DefaultUI" ) ;
460463 // Fix for games which don't ship with 'UI/Default' shader.
461464 if ( Graphic . defaultGraphicMaterial . shader ? . name != "UI/Default" )
462465 {
@@ -466,7 +469,6 @@ AssetBundle LoadBundle(string id)
466469 else
467470 BackupShader = Graphic . defaultGraphicMaterial . shader ;
468471
469- ConsoleFont = bundle . LoadAsset < Font > ( "CONSOLA" ) ;
470472 }
471473
472474 private static byte [ ] ReadFully ( Stream input )
0 commit comments