QDManager.cs 3.7 KB

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