FGUILauncher.cs 823 B

1234567891011121314151617181920212223
  1. using FairyGUI;
  2. namespace GFGGame
  3. {
  4. public class FGUILauncher
  5. {
  6. public static void Init()
  7. {
  8. #if (UNITY_5 || UNITY_5_3_OR_NEWER)
  9. //Use the font names directly
  10. UIConfig.defaultFont = "Microsoft YaHei";
  11. #else
  12. //Need to put a ttf file into Resources folder. Here is the file name of the ttf file.
  13. // UIExcelConfig.defaultFont = "afont";
  14. #endif
  15. //对于FGUI来说,其内部在执行 `UIPackage.RemovePackage` 时会进行`ab.Unload(true)`操作,应该是个很贴心的设计,但我们xasset需要管理资源的引用计数,所以不需要这个贴心的功能,故:
  16. UIPackage.unloadBundleByFGUI = false;
  17. //设置CustomLoader
  18. UIObjectFactory.SetLoaderExtension(typeof(GFGGLoader));
  19. }
  20. }
  21. }