GameLauncher.cs 831 B

123456789101112131415161718192021222324252627282930313233
  1. using UnityEngine;
  2. using GFGGame;
  3. using GFGGame.Launcher;
  4. using FairyGUI;
  5. using System;
  6. using System.Collections.Generic;
  7. public class GameLauncher : MonoBehaviour
  8. {
  9. private void Awake()
  10. {
  11. DontDestroyOnLoad(gameObject);
  12. }
  13. // Start is called before the first frame update
  14. void Start()
  15. {
  16. Screen.sleepTimeout = SleepTimeout.NeverSleep;
  17. Application.runInBackground = true;
  18. LauncherConfig.InitScriptCompilation();
  19. FGUILauncher.Init();
  20. HealthAdviceView.Open();
  21. int time = LauncherConfig.netType == LauncherConfig.EnumNetType.TISHEN ? 10 : 1;
  22. Timers.inst.Add(time, 1, (object param) =>
  23. {
  24. HealthAdviceView.Close();
  25. LauncherView.Instance.Open();
  26. LauncherController.InitLauncherCfg();
  27. });
  28. }
  29. }