QDManagerInit.cs 1.9 KB

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