QDManagerInit.cs 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. using UnityEngine;
  2. using UniFramework.Event;
  3. namespace GFGGame.Launcher
  4. {
  5. public class QDManagerInit
  6. {
  7. public static void InitPlatform()
  8. {
  9. Debug.Log($"调试102");
  10. switch (LauncherConfig.ChannelId)
  11. {
  12. default:
  13. UniEvent.SendMessage(new LauncherEvent.InitPlatformResult() { success = true });
  14. break;
  15. }
  16. }
  17. public static void UpdateApp()
  18. {
  19. switch (LauncherConfig.ChannelId)
  20. {
  21. default:
  22. if (!string.IsNullOrEmpty(LauncherConfig.updateUrl))
  23. {
  24. if (string.IsNullOrEmpty(LauncherConfig.updateAppPrompt))
  25. {
  26. LauncherConfig.updateAppPrompt = "需要安装新的安装包。";
  27. }
  28. var obj = Alert.Show(LauncherConfig.updateAppPrompt);
  29. if (LauncherConfig.updateEndTime > LauncherTimeUtil.GetCurrentTimestamp())
  30. {
  31. obj = obj.SetLeftButton(true, "继续游戏", (data) => { VersionController.Instance.Init(); });
  32. }
  33. obj.SetRightButton(true, "确认安装", (data) => { Application.OpenURL(LauncherConfig.updateUrl); });
  34. }
  35. else
  36. {
  37. if (string.IsNullOrEmpty(LauncherConfig.updateAppPrompt))
  38. {
  39. LauncherConfig.updateAppPrompt = "需要安装新的安装包,请联系研发获取。";
  40. }
  41. Alert.Show(LauncherConfig.updateAppPrompt)
  42. .SetLeftButton(true, "知道了", (data) => { Application.Quit(); });
  43. }
  44. break;
  45. }
  46. }
  47. }
  48. }