コード例 #1
0
        public static void setLanguage(NCommon.GameLanguage gameLanguage)
        {
#if UNITY_EDITOR
            {
                Debug.Log("GamePot - UNITY EDITOR setLanguage not supported");
            }
#elif UNITY_IOS
            GamePotUnityPluginiOS.setLanguage((int)gameLanguage);
#elif UNITY_ANDROID
            GamePotUnityPluginAOS.setLanguage((int)gameLanguage);
#endif
        }
コード例 #2
0
        public static bool isLinked(string linkType)
        {
#if UNITY_EDITOR
            {
                Debug.Log("GamePot - UNITY EDITOR always returns isLinked false");
            }
            return(false);
#elif UNITY_IOS
            return(GamePotUnityPluginiOS.isLinked(linkType));
#elif UNITY_ANDROID
            return(GamePotUnityPluginAOS.isLinked(linkType));
#endif
        }
コード例 #3
0
        public static void cancelLocalPush(string pushId)
        {
#if UNITY_EDITOR
            {
                Debug.Log("GamePot - UNITY EDITOR cancelLocalPush not supported");
            }
            return;
#elif UNITY_IOS
            GamePotUnityPluginiOS.cancelLocalPush(Int32.Parse(pushId));
#elif UNITY_ANDROID
            GamePotUnityPluginAOS.cancelLocalPush(Int32.Parse(pushId));
#endif
        }
コード例 #4
0
        //send Local Push
        public static int sendLocalPush(DateTime sendDate, string title, string message)
        {
#if UNITY_EDITOR
            {
                Debug.Log("GamePot - UNITY EDITOR sendLocalPush always return -1");
            }
            return(-1);
#elif UNITY_IOS
            return(GamePotUnityPluginiOS.sendLocalPush(sendDate.ToString("yyyy-MM-dd HH:mm:ss"), title, message));
#elif UNITY_ANDROID
            return(GamePotUnityPluginAOS.sendLocalPush(sendDate, title, message));
#endif
        }
コード例 #5
0
        public static void loginByThirdPartySDK(string userId)
        {
            Debug.Log("[GPUnity][Call] loginByThirdPartySDK");

#if UNITY_EDITOR
            {
                Debug.Log("GamePot - UNITY EDITOR loginByThirdPartySDK not supported");
            }
#elif UNITY_IOS
            GamePotUnityPluginiOS.loginByThirdPartySDK(userId);
#elif UNITY_ANDROID
            GamePotUnityPluginAOS.loginByThirdPartySDK(userId);
#endif
        }
コード例 #6
0
        public static void sendPurchaseByThirdPartySDK(string productId, string transactionId, string currency, double price, string store, string paymentId, string uniqueId)
        {
            Debug.Log("[GPUnity][Call] sendPurchaseByThirdPartySDK");

#if UNITY_EDITOR
            {
                Debug.Log("GamePot - UNITY EDITOR sendPurchaseByThirdPartySDK not supported");
            }
#elif UNITY_IOS
            GamePotUnityPluginiOS.sendPurchaseByThirdPartySDK(productId, transactionId, currency, price, store, paymentId, uniqueId);
#elif UNITY_ANDROID
            GamePotUnityPluginAOS.sendPurchaseByThirdPartySDK(productId, transactionId, currency, price, store, paymentId, uniqueId);
#endif
        }
コード例 #7
0
        public static void showFaq()
        {
            Debug.Log("[GPUnity][Call] showFaq");

#if UNITY_EDITOR
            {
                Debug.Log("GamePot - UNITY EDITOR showFaq not supported");
            }
#elif UNITY_IOS
            GamePotUnityPluginiOS.showFaq();
#elif UNITY_ANDROID
            GamePotUnityPluginAOS.showFaq();
#endif
        }
コード例 #8
0
        public static void e(string errCode, string errMessage)
        {
            Debug.Log("[GPUnity][Call] e");

#if UNITY_EDITOR
            {
                Debug.Log("GamePot - UNITY EDITOR sendLog not supported");
            }
#elif UNITY_IOS
            GamePotUnityPluginiOS.sendLog("e", errCode, errMessage);
#elif UNITY_ANDROID
            GamePotUnityPluginAOS.sendLog("e", errCode, errMessage);
#endif
        }
コード例 #9
0
        public static void showAppStatusPopup(string status)
        {
            Debug.Log("[GPUnity][Call] showAppStatusPopup - " + status);

#if UNITY_EDITOR
            {
                Debug.Log("GamePot - UNITY EDITOR showAppStatusPopup not supported");
            }
#elif UNITY_IOS
            GamePotUnityPluginiOS.showAppStatusPopup(status);
#elif UNITY_ANDROID
            GamePotUnityPluginAOS.showAppStatusPopup(status);
#endif
        }
コード例 #10
0
        public static void setLoggerUserid(string userid)
        {
            Debug.Log("[GPUnity][Call] setLoggerUserid");

#if UNITY_EDITOR
            {
                Debug.Log("GamePot - UNITY EDITOR sendLog not supported");
            }
#elif UNITY_IOS
            GamePotUnityPluginiOS.setLoggerUserid(userid);
#elif UNITY_ANDROID
            GamePotUnityPluginAOS.setLoggerUserid(userid);
#endif
        }
コード例 #11
0
        public static void showNotice(bool showTodayButton)
        {
            Debug.Log("[GPUnity][Call] showNotice");

#if UNITY_EDITOR
            {
                Debug.Log("GamePot - UNITY EDITOR showNotice not supported");
            }
#elif UNITY_IOS
            GamePotUnityPluginiOS.showNotice(showTodayButton);
#elif UNITY_ANDROID
            GamePotUnityPluginAOS.showNotice(showTodayButton);
#endif
        }
コード例 #12
0
        public static string getConfigs()
        {
            string result = "";

#if UNITY_EDITOR
            {
                Debug.Log("GamePot - UNITY EDITOR getConfigs always returns empty");
            }
#elif UNITY_IOS
            result = GamePotUnityPluginiOS.getConfigs();
#elif UNITY_ANDROID
            result = GamePotUnityPluginAOS.getConfigs();
#endif
            return(result);
        }
コード例 #13
0
        public static NPurchaseItem[] getPurchaseItems()
        {
            string result = "";

#if UNITY_EDITOR
            {
                Debug.Log("GamePot - UNITY EDITOR getPurchaseItems always returns empty");
            }
#elif UNITY_IOS
            result = GamePotUnityPluginiOS.getPurchaseItems();
#elif UNITY_ANDROID
            result = GamePotUnityPluginAOS.getPurchaseItems();
#endif
            NPurchaseItem[] itemData = JsonMapper.ToObject <NPurchaseItem[]>(result);
            return(itemData);
        }
コード例 #14
0
        public static void initPlugin()
        {
#if UNITY_EDITOR
            {
                if (GamePotEventListener.s_instance == null)
                {
                    Debug.Log("GamePot - Creating GamePot Native Bridge Receiver");
                    new GameObject("GamePotManager", typeof(GamePotEventListener));
                }
            }
#elif UNITY_IOS
            GamePotUnityPluginiOS.initPlugin();
#elif UNITY_ANDROID
            GamePotUnityPluginAOS.initPlugin();
#endif
        }
コード例 #15
0
        public static NCommon.LoginType getLastLoginType()
        {
            string result = "";

#if UNITY_EDITOR
            Debug.Log("GamePot - UNITY EDITOR getLastLoginType always returns NONE");
#elif UNITY_IOS
            result = GamePotUnityPluginiOS.getLastLoginType();
#elif UNITY_ANDROID
            result = GamePotUnityPluginAOS.getLastLoginType();
#endif

            switch (result)
            {
            case "GOOGLE":
                return(NCommon.LoginType.GOOGLE);

            case "GOOGLEPLAY":
                return(NCommon.LoginType.GOOGLEPLAY);

            case "FACEBOOK":
                return(NCommon.LoginType.FACEBOOK);

            case "NAVER":
                return(NCommon.LoginType.NAVER);

            case "GAMECENTER":
                return(NCommon.LoginType.GAMECENTER);

            case "TWITTER":
                return(NCommon.LoginType.TWITTER);

            case "LINE":
                return(NCommon.LoginType.LINE);

            case "APPLE":
                return(NCommon.LoginType.APPLE);

            case "GUEST":
                return(NCommon.LoginType.GUEST);

            case "THIRDPARTYSDK":
                return(NCommon.LoginType.THIRDPARTYSDK);
            }

            return(NCommon.LoginType.NONE);
        }
コード例 #16
0
        public static string getPushToken()
        {
            Debug.Log("[GPUnity][Call] getFCMToken");
            string token = "";

#if UNITY_EDITOR
            {
                Debug.Log("GamePot -  getFCMToken always returns empty string");
            }
#elif UNITY_IOS
            token = GamePotUnityPluginiOS.getPushToken();
#elif UNITY_ANDROID
            token = GamePotUnityPluginAOS.getFCMToken();
#endif

            return(token);
        }
コード例 #17
0
        public static void deleteMember()
        {
#if UNITY_EDITOR
            Debug.Log("GamePot - UNITY EDITOR DUMMY CALLBACK deleteMember always success");
            // Temporary user info for UnityEditor Development mode
            if (GamePotEventListener.s_instance != null)
            {
                GamePotEventListener.s_instance.onDeleteMemberSuccess();
            }
            else
            {
                Debug.LogError("GamePot UnityEditor listener is NULL");
            }
#elif UNITY_IOS
            GamePotUnityPluginiOS.deleteMember();
#elif UNITY_ANDROID
            GamePotUnityPluginAOS.deleteMember();
#endif
        }
コード例 #18
0
        public static NPushInfo getPushStatus()
        {
            Debug.Log("[GPUnity][Call] getPushStatus");
            string result = "";

#if UNITY_EDITOR
            {
                Debug.Log("GamePot - UNITY EDITOR getPushStatus always returns empty");
            }
#elif UNITY_IOS
            result = GamePotUnityPluginiOS.getPushStatus();
#elif UNITY_ANDROID
            result = GamePotUnityPluginAOS.getPushStatus();
#endif

            Debug.Log("[GPUnity][Call] getPushStatus result : " + result);

            NPushInfo pushInfo = JsonMapper.ToObject <NPushInfo>(result);
            return(pushInfo);
        }
コード例 #19
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
        }
コード例 #20
0
        public static void deleteLinking(NCommon.LinkingType linkType)
        {
#if UNITY_EDITOR
            {
                Debug.Log("GamePot - UNITY EDITOR DUMMY CALLBACK deleteLinking always faulure");
                // Temporary user info for UnityEditor Development mode
                if (GamePotEventListener.s_instance != null)
                {
                    GamePotEventListener.s_instance.onDeleteLinkingFailure("");
                }
                else
                {
                    Debug.LogError("GamePot UnityEditor listener is NULL");
                }
            }
#elif UNITY_IOS
            GamePotUnityPluginiOS.deleteLinking(linkType);
#elif UNITY_ANDROID
            GamePotUnityPluginAOS.deleteLinking(linkType);
#endif
        }
コード例 #21
0
        public static void purchase(string productId, string uniqueId, string serverId, string playerId, string etc)
        {
#if UNITY_EDITOR
            {
                Debug.Log("GamePot - UNITY EDITOR DUMMY CALLBACK purchase always cancelled");
                // Temporary user info for UnityEditor Development mode
                if (GamePotEventListener.s_instance != null)
                {
                    GamePotEventListener.s_instance.onPurchaseCancel();
                }
                else
                {
                    Debug.LogError("GamePot UnityEditor listener is NULL");
                }
            }
#elif UNITY_IOS
            GamePotUnityPluginiOS.purchase(productId, uniqueId, serverId, playerId, etc);
#elif UNITY_ANDROID
            GamePotUnityPluginAOS.purchase(productId, uniqueId, serverId, playerId, etc);
#endif
        }
コード例 #22
0
        public static void coupon(string couponNumber, string userData)
        {
#if UNITY_EDITOR
            {
                Debug.Log("GamePot - UNITY EDITOR DUMMY CALLBACK coupon always success");
                // Temporary user info for UnityEditor Development mode
                if (GamePotEventListener.s_instance != null)
                {
                    GamePotEventListener.s_instance.onCouponSuccess("");
                }
                else
                {
                    Debug.LogError("GamePot UnityEditor listener is NULL");
                }
            }
#elif UNITY_IOS
            GamePotUnityPluginiOS.coupon(couponNumber, userData);
#elif UNITY_ANDROID
            GamePotUnityPluginAOS.coupon(couponNumber, userData);
#endif
        }
コード例 #23
0
        public static void setPushNightStatus(bool nightPushEnable)
        {
            Debug.Log("[GPUnity][Call] setPushNightStatus : " + nightPushEnable);

#if UNITY_EDITOR
            {
                // Temporary user info for UnityEditor Development mode
                if (GamePotEventListener.s_instance != null)
                {
                    GamePotEventListener.s_instance.onPushNightSuccess();
                }
                else
                {
                    Debug.LogError("GamePot UnityEditor listener is NULL");
                }
            }
#elif UNITY_IOS
            GamePotUnityPluginiOS.setPushNight(nightPushEnable);
#elif UNITY_ANDROID
            GamePotUnityPluginAOS.setPushNight(nightPushEnable);
#endif
        }
コード例 #24
0
        public static void setPushStatus(bool pushEnable)
        {
            Debug.Log("[GPUnity][Call] setPushStatus : " + pushEnable);
#if UNITY_EDITOR
            {
                Debug.Log("GamePot - UNITY EDITOR DUMMY CALLBACK setPush always success");
                // Temporary user info for UnityEditor Development mode
                if (GamePotEventListener.s_instance != null)
                {
                    GamePotEventListener.s_instance.onPushSuccess();
                }
                else
                {
                    Debug.LogError("GamePot UnityEditor listener is NULL");
                }
            }
#elif UNITY_IOS
            GamePotUnityPluginiOS.setPush(pushEnable);
#elif UNITY_ANDROID
            GamePotUnityPluginAOS.setPush(pushEnable);
#endif
        }
コード例 #25
0
        public static void login(NCommon.LoginType loginType)
        {
#if 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();
                }
            }
#elif UNITY_IOS
            GamePotUnityPluginiOS.login(loginType);
#elif UNITY_ANDROID
            GamePotUnityPluginAOS.login(loginType);
#endif
        }
コード例 #26
0
        public static bool characterInfo(GamePotSendLogCharacter info)
        {
            Debug.Log("[GPUnity][Call] characterInfo");
            bool result = false;

            if (info == null)
            {
                Debug.Log("GamePotSendLogCharacter is null");
                return(false);
            }

#if UNITY_EDITOR
            {
                Debug.Log("GamePot - characterInfo always returns false");
            }
#elif UNITY_IOS
            result = GamePotUnityPluginiOS.characterInfo(info.toString());
#elif UNITY_ANDROID
            result = GamePotUnityPluginAOS.characterInfo(info.toString());
#endif

            return(result);
        }
コード例 #27
0
        public static void showAgreeDialog(NAgreeInfo info)
        {
            Debug.Log("[GPUnity][Call] showAgreeDialog");

#if UNITY_EDITOR
            {
                Debug.Log("GamePot - UNITY EDITOR DUMMY CALLBACK showAgreeDialog always success");
                // Temporary user info for UnityEditor Development mode
                if (GamePotEventListener.s_instance != null)
                {
                    string successResultJson = "{\"agree\":true,\"agreeNight\":true}";
                    GamePotEventListener.s_instance.onAgreeDialogSuccess(successResultJson);
                }
                else
                {
                    Debug.LogError("GamePot UnityEditor listener is NULL");
                }
            }
#elif UNITY_IOS
            GamePotUnityPluginiOS.showAgreeDialog(info != null ? info.ToJson().ToString() : null);
#elif UNITY_ANDROID
            GamePotUnityPluginAOS.showAgreeDialog(info != null ? info.ToJson().ToString() : null);
#endif
        }
コード例 #28
0
        public static List <NLinkingInfo> getLinkedList()
        {
            string result = "";

#if UNITY_EDITOR
            {
                Debug.Log("GamePot - UNITY EDITOR always returns empty linked list");
            }
#elif UNITY_IOS
            result = GamePotUnityPluginiOS.getLinkedList();
#elif UNITY_ANDROID
            result = GamePotUnityPluginAOS.getLinkedList();
#endif

            JsonData            data     = JsonMapper.ToObject(result);
            List <NLinkingInfo> itemData = new List <NLinkingInfo>();
            if (data.IsArray || data.IsObject)
            {
                foreach (JsonData item in data)
                {
                    Debug.Log("GamePot::getLinkedList-" + item["provider"]);

                    NLinkingInfo info = new NLinkingInfo();
                    if (item["provider"].ToString() == "google")
                    {
                        info.provider = NCommon.LinkingType.GOOGLE;
                    }
                    else if (item["provider"].ToString() == "facebook")
                    {
                        info.provider = NCommon.LinkingType.FACEBOOK;
                    }
                    else if (item["provider"].ToString() == "naver")
                    {
                        info.provider = NCommon.LinkingType.NAVER;
                    }
                    else if (item["provider"].ToString() == "googleplay")
                    {
                        info.provider = NCommon.LinkingType.GOOGLEPLAY;
                    }
                    else if (item["provider"].ToString() == "gamecenter")
                    {
                        info.provider = NCommon.LinkingType.GAMECENTER;
                    }
                    else if (item["provider"].ToString() == "line")
                    {
                        info.provider = NCommon.LinkingType.LINE;
                    }
                    else if (item["provider"].ToString() == "twitter")
                    {
                        info.provider = NCommon.LinkingType.TWITTER;
                    }
                    else if (item["provider"].ToString() == "apple")
                    {
                        info.provider = NCommon.LinkingType.APPLE;
                    }
                    else if (item["provider"].ToString() == "thirdpartysdk")
                    {
                        info.provider = NCommon.LinkingType.THIRDPARTYSDK;
                    }
                    itemData.Add(info);
                }
            }
            return(itemData);
        }