QDManager.cs 3.3 KB

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