QDManager.cs 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  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. break;
  43. default:
  44. break;
  45. }
  46. }
  47. public static void OnEnterGame()
  48. {
  49. switch (LauncherConfig.ChannelId)
  50. {
  51. case (int)ChannelID.Test:
  52. break;
  53. default:
  54. break;
  55. }
  56. }
  57. //回到登录界面,不退出账号
  58. public static void OnQuitToLoginView()
  59. {
  60. switch (LauncherConfig.ChannelId)
  61. {
  62. case (int)ChannelID.Test:
  63. break;
  64. default:
  65. break;
  66. }
  67. }
  68. public static void Pay(int buyID, int count, string orderID, long price)
  69. {
  70. switch (LauncherConfig.ChannelId)
  71. {
  72. case (int)ChannelID.Test:
  73. break;
  74. default:
  75. break;
  76. }
  77. }
  78. public static void Logout()
  79. {
  80. GameGlobal.zoneScene.GetComponent<SessionComponent>()?.Disconnect();
  81. GameGlobal.zoneScene.GetComponent<ServerInfosComponent>()?.ServerInfoList?.Clear();
  82. GameGlobal.zoneScene.GetComponent<AccountInfoComponent>()?.Clear();
  83. if (PlayerPrefs.HasKey(GameConst.PASSWORD_LAST_LOGIN_KEY))
  84. {
  85. PlayerPrefs.DeleteKey(GameConst.PASSWORD_LAST_LOGIN_KEY);
  86. }
  87. switch (LauncherConfig.ChannelId)
  88. {
  89. case (int)ChannelID.Test:
  90. break;
  91. default:
  92. break;
  93. }
  94. }
  95. public static void Exit()
  96. {
  97. switch (LauncherConfig.ChannelId)
  98. {
  99. case (int)ChannelID.Test:
  100. GameController.ShowExitAlert();
  101. break;
  102. default:
  103. break;
  104. }
  105. }
  106. public static bool IsTaptap
  107. {
  108. get { return LauncherConfig.ChannelId == 101; }
  109. }
  110. }
  111. }