QDManager.cs 4.2 KB

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