QDManagerInit.cs 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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. case (int)ChannelID.AppStore:
  12. QDAppStoreManagerInit.InitPlatform();
  13. break;
  14. default:
  15. UniEvent.SendMessage(new LauncherEvent.InitPlatformResult() { success = true});
  16. break;
  17. }
  18. }
  19. public static void UpdateApp()
  20. {
  21. switch(LauncherConfig.ChannelId)
  22. {
  23. case (int)ChannelID.AppStore:
  24. QDAppStoreManagerInit.UpdateApp();
  25. break;
  26. default:
  27. if(!string.IsNullOrEmpty(LauncherConfig.updateUrl))
  28. {
  29. if (string.IsNullOrEmpty(LauncherConfig.updateAppPrompt))
  30. {
  31. LauncherConfig.updateAppPrompt = "需要安装新的安装包。";
  32. }
  33. Alert.Show(LauncherConfig.updateAppPrompt)
  34. .SetLeftButton(true, "前往更新", (data) =>
  35. {
  36. Application.OpenURL(LauncherConfig.updateUrl);
  37. });
  38. }
  39. else
  40. {
  41. if (string.IsNullOrEmpty(LauncherConfig.updateAppPrompt))
  42. {
  43. LauncherConfig.updateAppPrompt = "需要安装新的安装包,请联系研发获取。";
  44. }
  45. Alert.Show(LauncherConfig.updateAppPrompt)
  46. .SetLeftButton(true, "知道了", (data) =>
  47. {
  48. Application.Quit();
  49. });
  50. }
  51. break;
  52. }
  53. }
  54. }
  55. }