QDManagerInit.cs 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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. default:
  24. if(!string.IsNullOrEmpty(LauncherConfig.updateUrl))
  25. {
  26. if (string.IsNullOrEmpty(LauncherConfig.updateAppPrompt))
  27. {
  28. LauncherConfig.updateAppPrompt = "需要安装新的安装包。";
  29. }
  30. Alert.Show(LauncherConfig.updateAppPrompt)
  31. .SetLeftButton(true, "前往更新", (data) =>
  32. {
  33. Application.OpenURL(LauncherConfig.updateUrl);
  34. });
  35. }
  36. else
  37. {
  38. if (string.IsNullOrEmpty(LauncherConfig.updateAppPrompt))
  39. {
  40. LauncherConfig.updateAppPrompt = "需要安装新的安装包,请联系研发获取。";
  41. }
  42. Alert.Show(LauncherConfig.updateAppPrompt)
  43. .SetLeftButton(true, "知道了", (data) =>
  44. {
  45. Application.Quit();
  46. });
  47. }
  48. break;
  49. }
  50. }
  51. }
  52. }