QDManagerInit.cs 1.8 KB

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