QDManagerInit.cs 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. using UnityEngine;
  2. namespace GFGGame.Launcher
  3. {
  4. public class QDManagerInit
  5. {
  6. public static void InitPlatform()
  7. {
  8. switch (LauncherConfig.ChannelId)
  9. {
  10. default:
  11. DouYouSDK.Instance().InitDouYouSdk(DouYouSDK.Instance().GetAdId());
  12. break;
  13. }
  14. }
  15. public static void UpdateApp()
  16. {
  17. switch(LauncherConfig.ChannelId)
  18. {
  19. default:
  20. if(!string.IsNullOrEmpty(LauncherConfig.updateUrl))
  21. {
  22. if (string.IsNullOrEmpty(LauncherConfig.updateAppPrompt))
  23. {
  24. LauncherConfig.updateAppPrompt = "需要安装新的安装包。";
  25. }
  26. Alert.Show(LauncherConfig.updateAppPrompt)
  27. .SetLeftButton(true, "前往更新", (data) =>
  28. {
  29. Application.OpenURL(LauncherConfig.updateUrl);
  30. });
  31. }
  32. else
  33. {
  34. if (string.IsNullOrEmpty(LauncherConfig.updateAppPrompt))
  35. {
  36. LauncherConfig.updateAppPrompt = "需要安装新的安装包,请联系研发获取。";
  37. }
  38. Alert.Show(LauncherConfig.updateAppPrompt)
  39. .SetLeftButton(true, "知道了", (data) =>
  40. {
  41. Application.Quit();
  42. });
  43. }
  44. break;
  45. }
  46. }
  47. }
  48. }