QDManager.cs 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. namespace GFGGame
  2. {
  3. public class QDManager
  4. {
  5. public static bool isInited = false;
  6. public static void InitPlatform()
  7. {
  8. ViewManager.Show<ModalStatusView>("正在初始化...");
  9. switch (LauncherConfig.ChannelId)
  10. {
  11. case (int)ChannelID.AppStore:
  12. QDAppStore.InitPlatform();
  13. break;
  14. default:
  15. EventAgent.DispatchEvent(ConstMessage.ON_PLATFORM_SDK_INITED, true);
  16. break;
  17. }
  18. }
  19. public static void Login()
  20. {
  21. ViewManager.Show<ModalStatusView>("登录中...");
  22. switch (LauncherConfig.ChannelId)
  23. {
  24. default:
  25. bool login = GameController.CheckLoginCache(true);
  26. if (!login)
  27. {
  28. ViewManager.Hide<ModalStatusView>();
  29. ViewManager.Show<LoginInputView>();
  30. }
  31. break;
  32. }
  33. }
  34. public static void OnCreateRole()
  35. {
  36. switch (LauncherConfig.ChannelId)
  37. {
  38. default:
  39. break;
  40. }
  41. }
  42. public static void OnEnterGame()
  43. {
  44. switch (LauncherConfig.ChannelId)
  45. {
  46. case (int)ChannelID.AppStore:
  47. QDAppStore.OnEnterGame();
  48. break;
  49. default:
  50. break;
  51. }
  52. }
  53. //回到登录界面,不退出账号
  54. public static void OnQuitToLoginView()
  55. {
  56. switch (LauncherConfig.ChannelId)
  57. {
  58. default:
  59. break;
  60. }
  61. }
  62. public static void Pay(int buyID, int count, string orderID, long Price)
  63. {
  64. switch (LauncherConfig.ChannelId)
  65. {
  66. case (int)ChannelID.AppStore:
  67. QDAppStore.Pay(buyID, count, orderID, Price);
  68. break;
  69. default:
  70. break;
  71. }
  72. }
  73. public static void Logout()
  74. {
  75. switch (LauncherConfig.ChannelId)
  76. {
  77. default:
  78. break;
  79. }
  80. }
  81. public static void Exit()
  82. {
  83. switch (LauncherConfig.ChannelId)
  84. {
  85. case (int)ChannelID.Test:
  86. GameController.ShowExitAlert();
  87. break;
  88. default:
  89. break;
  90. }
  91. }
  92. public static bool IsTaptap
  93. {
  94. get
  95. {
  96. return LauncherConfig.ChannelId == (int)ChannelID.TapTap;
  97. }
  98. }
  99. public static bool IsHYKB
  100. {
  101. get
  102. {
  103. return LauncherConfig.ChannelId == (int)ChannelID.HYKB;
  104. }
  105. }
  106. public static bool IsBiliBili
  107. {
  108. get
  109. {
  110. return LauncherConfig.ChannelId == (int)ChannelID.BiliBili;
  111. }
  112. }
  113. public static bool IsHuaWei
  114. {
  115. get
  116. {
  117. return LauncherConfig.ChannelId == (int)ChannelID.HUAWEI;
  118. }
  119. }
  120. }
  121. }