VersionCheker.cs 861 B

12345678910111213141516171819202122232425262728293031
  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. HealthAdviceView.Open();
  19. int time = LauncherConfig.netType == LauncherConfig.EnumNetType.TISHEN ? 10 : 1;
  20. Timers.inst.Add(time, 1, (object param) =>
  21. {
  22. HealthAdviceView.Close();
  23. LauncherView.Instance.Open();
  24. LauncherController.InitLauncherCfg();
  25. });
  26. }
  27. }
  28. }