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 }
public static void showWebView(string url) { Debug.Log("[GPUnity][Call] showWebView url : " + url); #if UNITY_EDITOR { Debug.Log("GamePot - UNITY EDITOR showWebView not supported"); } #elif UNITY_IOS { GamePotEventListener listener = GamePotEventListener.s_instance; GamePotUnityPluginiOS.showWebView(url); // IOS doesn't return Any Callback listener.onWebviewClose(""); } #elif UNITY_ANDROID { GamePotUnityPluginAOS.showWebView(url); } #endif }
private void OnDestroy() { s_instance = null; }
private void Awake() { s_instance = this; DontDestroyOnLoad(gameObject); }