/// <summary> /// 登出当前用户 /// </summary> public static void logout() { #if UNITY_ANDROID KTAccountManagerAndroid.logout(); #elif UNITY_IOS KTAccountManageriOS.logout(); #else #endif }
/// <summary> /// 使用网游帐户登录KTPlay平台 /// </summary> /// <param name="gameUserId">游戏用户ID</param> /// <param name="obj">MonoBehaviour子类对象</param> /// <param name="callbackMethod">监听事件响应</param> public static void loginWithGameUser(string gameUserId, MonoBehaviour obj, KTAccountManager.Callback callbackMethod) { #if UNITY_ANDROID KTAccountManagerAndroid.loginWithGameUser(gameUserId, obj, callbackMethod); #elif UNITY_IOS KTAccountManageriOS.loginWithGameUser(gameUserId, obj, callbackMethod); #else #endif }
/// <summary> /// 修改当前登录帐户昵称 /// </summary> /// <param name="nickname">新昵称</param> /// <param name="obj">MonoBehaviour子类对象</param> /// <param name="callbackMethod">监听事件响应</param> public static void setNickname(string nickName, MonoBehaviour obj, KTAccountManager.Callback callbackMethod) { #if UNITY_ANDROID KTAccountManagerAndroid.setNickname(nickName, obj, callbackMethod); #elif UNITY_IOS KTAccountManageriOS.setNickname(nickName, obj, callbackMethod); #else #endif }
/// <summary> /// 打开KTPlay登录界面 /// </summary> /// <param name="closeable">closeable 登录界面是否可由玩家关闭, YES 可以,NO 不可以</param> /// <param name="obj">MonoBehaviour子类对象</param> /// <param name="callbackMethod">监听事件响应</param> public static void ShowLoginView(bool closeable, MonoBehaviour obj, KTAccountManager.Callback callbackMethod) { #if UNITY_ANDROID KTAccountManagerAndroid.ShowLoginView(closeable, obj, callbackMethod); #elif UNITY_IOS KTAccountManageriOS.ShowLoginView(closeable, obj, callbackMethod); #else #endif }
/// <summary> /// 获取任意KTplay用户信息 /// </summary> /// <param name="userId">KT用户唯一标示符</param> /// <param name="obj">MonoBehaviour子类对象</param> /// <param name="callbackMethod">监听事件响应</param> public static void UserProfile(string userId, MonoBehaviour obj, KTAccountManager.Callback callbackMethod) { #if UNITY_ANDROID KTAccountManagerAndroid.UserProfile(userId, obj, callbackMethod); #elif UNITY_IOS KTAccountManageriOS.UserProfile(userId, obj, callbackMethod); #else #endif }
/// <summary> /// 设置监听者,监听KTPlay登录状态变更 /// </summary> /// <param name="obj">MonoBehaviour子类对象</param> /// <param name="callbackMethod">监听事件响应</param> public static void SetLoginStatusChange(MonoBehaviour obj, KTAccountManager.Callback callbackMethod) { #if UNITY_ANDROID KTAccountManagerAndroid.SetLoginStatusChangeCallback(obj, callbackMethod); #elif UNITY_IOS KTAccountManageriOS.SetLoginStatusChangeCallback(obj, callbackMethod); #else #endif }
/// <summary> /// 获取当前登录KTplay用户信息 /// </summary> /// <return>返回KTplay用户信息,如果用户未登录返回为nil</return> public static KTUser CurrentAccount() { #if UNITY_ANDROID return(KTAccountManagerAndroid.CurrentAccount()); #elif UNITY_IOS return(KTAccountManageriOS.CurrentAccount()); #else #endif return(null); }
/// <summary> /// 判断是否已有用户登录 /// </summary> /// <return>是否已有用户登录</return> public static bool IsLoggedIn() { #if UNITY_ANDROID return(KTAccountManagerAndroid.IsLoggedIn()); #elif UNITY_IOS return(KTAccountManageriOS.IsLoggedIn()); #else #endif return(false); }