QDManager.cs 3.8 KB

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