public static void login(NCommon.LoginType loginType) { #if UNITY_ANDROID { if (mGamePotClass != null) { mGamePotClass.CallStatic("login", loginType.ToString()); } } #elif UNITY_EDITOR { GamePotEventListener listener = GamePotEventListener.s_instance; if (loginType == NCommon.LoginType.GUEST) { Debug.Log("GamePot - UNITY EDITOR DUMMY CALLBACK login with GUEST. It does not communicate with server."); // Temporary user info for UnityEditor Development mode if (listener != null) { NUserInfo userInfo = new NUserInfo { memberid = "UE-" + SystemInfo.deviceUniqueIdentifier, userid = "UE-" + SystemInfo.deviceUniqueIdentifier, name = "UnityEditor", token = "UnityEditorTempToken" }; GamePotSettings.MemberInfo = userInfo; listener.onLoginSuccess(userInfo.ToJson()); } else { Debug.LogError("GamePot UnityEditor listener is NULL"); } } else { Debug.Log("GamePot - UNITY EDITOR DUMMY CALLBACK login cancelled"); listener.onLoginCancel(); } } #endif }
/// <summary> /// Login (callback delegate) /// </summary> /// <param name="loginType">Login Type</param> /// <param name="callback"></param> public static void login(NCommon.LoginType loginType, GamePotCallbackDelegate.CB_Login cbLogin) { GamePotEventListener.cbLogin = cbLogin; login(loginType); }