123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169 |
- using ET;
- using UnityEngine;
- namespace GFGGame
- {
- public class QDManager
- {
- public bool isLogining;
- public string uid;
-
- public static void Init()
- {
- switch(LauncherConfig.ChannelId)
- {
- default:
- QDDouYouManager.Instance.Init();
- break;
- }
- }
- public static void Login()
- {
- ViewManager.Show<ModalStatusView>("登录中...");
- switch (LauncherConfig.ChannelId)
- {
- case (int)ChannelID.TapTap:
-
- break;
- case (int)ChannelID.Test:
- bool login = GameController.CheckLoginCache(true);
- if (!login)
- {
- ViewManager.Hide<ModalStatusView>();
- ViewManager.Show<LoginInputView>();
- }
- break;
- case (int)ChannelID.DouYouTest:
- QDDouYouManager.Instance.Login();
- break;
- default:
- //QDDouYouManager.Instance.Login();
- break;
- }
- }
- public static void OnCreateRole()
- {
- switch (LauncherConfig.ChannelId)
- {
- case (int)ChannelID.TapTap:
-
- break;
- case (int)ChannelID.Test:
- break;
- case (int)ChannelID.DouYouTest:
- QDDouYouManager.Instance.OnCreateRole();
- break;
- default:
- //QDDouYouManager.Instance.OnCreateRole();
- break;
- }
- }
- public static void OnEnterGame()
- {
- switch (LauncherConfig.ChannelId)
- {
- case (int)ChannelID.TapTap:
-
- break;
- case (int)ChannelID.Test:
- break;
- case (int)ChannelID.DouYouTest:
- QDDouYouManager.Instance.OnEnterGame();
- break;
- default:
- //QDDouYouManager.Instance.OnEnterGame();
- break;
- }
- }
- //回到登录界面,不退出账号
- public static void OnQuitToLoginView()
- {
- switch (LauncherConfig.ChannelId)
- {
- case (int)ChannelID.TapTap:
-
- break;
- case (int)ChannelID.Test:
- break;
- case (int)ChannelID.DouYouTest:
- QDDouYouManager.Instance.OnQuitToLoginView();
- break;
- default:
- //QDDouYouManager.Instance.OnQuitToLoginView();
- break;
- }
- }
- public static void Pay(int buyID, int count, string orderID, long price)
- {
- switch (LauncherConfig.ChannelId)
- {
- case (int)ChannelID.TapTap:
-
- break;
- case (int)ChannelID.Test:
- break;
- case (int)ChannelID.DouYouTest:
- QDDouYouManager.Instance.Pay(buyID, count, orderID, price);
- break;
- default:
- //QDDouYouManager.Instance.Pay(buyID, count, orderID, price);
- break;
- }
- }
- public static void Logout(bool fromSdkLogoutCallback)
- {
- GameGlobal.zoneScene.GetComponent<SessionComponent>()?.Disconnect();
- GameGlobal.zoneScene.GetComponent<ServerInfosComponent>()?.ServerInfoList?.Clear();
- GameGlobal.zoneScene.GetComponent<AccountInfoComponent>()?.Clear();
- if (PlayerPrefs.HasKey(GameConst.PASSWORD_LAST_LOGIN_KEY))
- {
- PlayerPrefs.DeleteKey(GameConst.PASSWORD_LAST_LOGIN_KEY);
- }
- switch (LauncherConfig.ChannelId)
- {
- default:
- if(!fromSdkLogoutCallback)
- {
- QDDouYouManager.Instance.Logout();
- }
- break;
- }
- }
- public static void Exit()
- {
- switch (LauncherConfig.ChannelId)
- {
- case (int)ChannelID.Test:
- GameController.ShowExitAlert();
- break;
- case (int)ChannelID.DouYouTest:
- QDDouYouManager.Instance.Exit();
- break;
- default:
- //QDDouYouManager.Instance.Exit();
- break;
- }
- }
- public static bool IsTaptap
- {
- get
- {
- return LauncherConfig.ChannelId == (int)ChannelID.TapTap;
- }
- }
- }
- }
|