QDManagerInit.cs 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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.DouYouTest:
  12. QDDouYouManagerInit.Instance.InitSDK(QDDouYouManagerInit.Instance.GetAdId());
  13. QDShareManagerInit.Instance.InitSDK();
  14. break;
  15. default:
  16. UniEvent.SendMessage(new LauncherEvent.InitPlatformResult() { success = true });
  17. QDShareManagerInit.Instance.InitSDK();
  18. break;
  19. }
  20. }
  21. public static void UpdateApp()
  22. {
  23. switch (LauncherConfig.ChannelId)
  24. {
  25. default:
  26. if (!string.IsNullOrEmpty(LauncherConfig.updateUrl))
  27. {
  28. if (string.IsNullOrEmpty(LauncherConfig.updateAppPrompt))
  29. {
  30. LauncherConfig.updateAppPrompt = "需要安装新的安装包。";
  31. }
  32. Alert.Show(LauncherConfig.updateAppPrompt)
  33. .SetLeftButton(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. }