예제 #1
0
        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
        }
예제 #2
0
        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
        }
예제 #3
0
 private void OnDestroy()
 {
     s_instance = null;
 }
예제 #4
0
 private void Awake()
 {
     s_instance = this;
     DontDestroyOnLoad(gameObject);
 }