QDManager.cs 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  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. default:
  47. break;
  48. }
  49. }
  50. public static void OnEnterGame()
  51. {
  52. switch (LauncherConfig.ChannelId)
  53. {
  54. case (int)ChannelID.AppStore:
  55. QDAppStoreManager.OnEnterGame();
  56. break;
  57. default:
  58. break;
  59. }
  60. }
  61. //回到登录界面,不退出账号
  62. public static void OnQuitToLoginView()
  63. {
  64. switch (LauncherConfig.ChannelId)
  65. {
  66. default:
  67. break;
  68. }
  69. }
  70. public static void Pay(int buyID, int count, string orderID, long Price)
  71. {
  72. switch (LauncherConfig.ChannelId)
  73. {
  74. case (int)ChannelID.AppStore:
  75. QDAppStoreManager.Pay(buyID, count, orderID, Price);
  76. break;
  77. default:
  78. break;
  79. }
  80. }
  81. public static void Logout()
  82. {
  83. switch (LauncherConfig.ChannelId)
  84. {
  85. default:
  86. break;
  87. }
  88. }
  89. public static void Exit()
  90. {
  91. switch (LauncherConfig.ChannelId)
  92. {
  93. case (int)ChannelID.Test:
  94. GameController.ShowExitAlert();
  95. break;
  96. default:
  97. break;
  98. }
  99. }
  100. public static bool IsTaptap
  101. {
  102. get
  103. {
  104. return LauncherConfig.ChannelId == (int)ChannelID.TapTap;
  105. }
  106. }
  107. public static bool IsHYKB
  108. {
  109. get
  110. {
  111. return LauncherConfig.ChannelId == (int)ChannelID.HYKB;
  112. }
  113. }
  114. public static bool IsBiliBili
  115. {
  116. get
  117. {
  118. return LauncherConfig.ChannelId == (int)ChannelID.BiliBili;
  119. }
  120. }
  121. public static bool IsHuaWei
  122. {
  123. get
  124. {
  125. return LauncherConfig.ChannelId == (int)ChannelID.HUAWEI;
  126. }
  127. }
  128. }
  129. }