VersionCheker.cs 894 B

1234567891011121314151617181920212223242526272829303132
  1. using FairyGUI;
  2. using UnityEngine;
  3. namespace GFGGame
  4. {
  5. public class VersionCheker : MonoBehaviour
  6. {
  7. private void Awake()
  8. {
  9. var roots = this.gameObject.scene.GetRootGameObjects();
  10. foreach (var t in roots)
  11. {
  12. if (t.name == "FairyGUI" || t.name == "Stage Camera")
  13. {
  14. DontDestroyOnLoad(t);
  15. }
  16. }
  17. LauncherConfig.InitScriptCompilation();
  18. FGUILauncher.Init();
  19. HealthAdviceView.Open();
  20. int time = LauncherConfig.netType == LauncherConfig.EnumNetType.TISHEN ? 10 : 1;
  21. Timers.inst.Add(time, 1, (object param) =>
  22. {
  23. HealthAdviceView.Close();
  24. LauncherView.Instance.Open();
  25. LauncherController.InitLauncherCfg();
  26. });
  27. }
  28. }
  29. }