GameLauncher.cs 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. using UnityEngine;
  2. using GFGGame;
  3. using GFGGame.Launcher;
  4. using FairyGUI;
  5. using System;
  6. using System.Collections.Generic;
  7. using YooAsset;
  8. public class GameLauncher : MonoBehaviour
  9. {
  10. public static GameLauncher Instance;
  11. /// <summary>
  12. /// ×ÊԴϵͳÔËÐÐģʽ
  13. /// </summary>
  14. public EPlayMode PlayMode = EPlayMode.EditorSimulateMode;
  15. private void Awake()
  16. {
  17. Instance = this;
  18. DontDestroyOnLoad(gameObject);
  19. }
  20. // Start is called before the first frame update
  21. void Start()
  22. {
  23. Screen.sleepTimeout = SleepTimeout.NeverSleep;
  24. Application.runInBackground = true;
  25. LauncherConfig.InitScriptCompilation();
  26. FGUILauncher.Init();
  27. HealthAdviceView.Open();
  28. int time = LauncherConfig.netType == LauncherConfig.EnumNetType.TISHEN ? 10 : 1;
  29. Timers.inst.Add(time, 1, (object param) =>
  30. {
  31. HealthAdviceView.Close();
  32. LauncherView.Instance.Open();
  33. LauncherController.InitLauncherCfg();
  34. });
  35. }
  36. }