Exemplo n.º 1
0
        void UserExternalCall(string msg)
        {
            Debug.Log("UserExternalCall(" + msg + ")");
            Dictionary <string, string> dic = AnySDKUtil.stringToDictionary(msg);
            int    code   = Convert.ToInt32(dic["code"]);
            string result = dic["msg"];

            switch (code)
            {
            case (int)UserActionResultCode.kInitSuccess:            //初始化SDK成功回调
                break;

            case (int)UserActionResultCode.kInitFail:            //初始化SDK失败回调
                break;

            case (int)UserActionResultCode.kLoginSuccess:            //登陆成功回调
                break;

            case (int)UserActionResultCode.kLoginNetworkError:    //登陆失败回调
            case (int)UserActionResultCode.kLoginCancel:          //登陆取消回调
            case (int)UserActionResultCode.kLoginFail:            //登陆失败回调
                break;

            case (int)UserActionResultCode.kLogoutSuccess:            //登出成功回调
                break;

            case (int)UserActionResultCode.kLogoutFail:            //登出失败回调
                break;

            case (int)UserActionResultCode.kPlatformEnter:            //平台中心进入回调
                break;

            case (int)UserActionResultCode.kPlatformBack:            //平台中心退出回调
                break;

            case (int)UserActionResultCode.kPausePage:            //暂停界面回调
                break;

            case (int)UserActionResultCode.kExitPage:            //退出游戏回调
                break;

            case (int)UserActionResultCode.kAntiAddictionQuery:            //防沉迷查询回调
                break;

            case (int)UserActionResultCode.kRealNameRegister:            //实名注册回调
                break;

            case (int)UserActionResultCode.kAccountSwitchSuccess:            //切换账号成功回调
                break;

            case (int)UserActionResultCode.kAccountSwitchFail:            //切换账号成功回调
                break;

            case (int)UserActionResultCode.kOpenShop:            //应用汇  悬浮窗点击粮饷按钮回调
                break;

            default:
                break;
            }
        }
Exemplo n.º 2
0
        public void share(Dictionary <string, string> shareInfo)
        {
            string text = AnySDKUtil.dictionaryToString(shareInfo);

            Debug.Log("share   " + text);
            AnySDKREC.AnySDKREC_nativeShare(text);
        }
        public void onPay(Dictionary <string, string> userInfo)
        {
            string text = AnySDKUtil.dictionaryToString(userInfo);

            Debug.Log("onPay   " + text);
            AnySDKAdTracking.AnySDKAdTracking_nativeOnPay(text);
        }
Exemplo n.º 4
0
        void SocialExternalCall(string msg)
        {
            Debug.Log("SocialExternalCall(" + msg + ")");
            Dictionary <string, string> dic = AnySDKUtil.stringToDictionary(msg);
            int    code   = Convert.ToInt32(dic["code"]);
            string result = dic["msg"];

            switch (code)
            {
            case (int)SocialRetCode.kScoreSubmitSucceed:            //提交分数成功回调

                break;

            case (int)SocialRetCode.kScoreSubmitfail:            //提交分数失败回调

                break;

            case (int)SocialRetCode.kAchUnlockSucceed:            //解锁成F就成功回调

                break;

            case (int)SocialRetCode.kAchUnlockFail:            //解锁成就失败回调

                break;

            default:
                break;
            }
        }
Exemplo n.º 5
0
        void ShareExternalCall(string msg)
        {
            Debug.Log("ShareExternalCall(" + msg + ")");
            Dictionary <string, string> dic = AnySDKUtil.stringToDictionary(msg);
            int    code   = Convert.ToInt32(dic["code"]);
            string result = dic["msg"];

            switch (code)
            {
            case (int)ShareResultCode.kShareSuccess:            //分享成功回调
                break;

            case (int)ShareResultCode.kShareFail:            //分享失败回调
                break;

            case (int)ShareResultCode.kShareCancel:            //分享取消回调
                break;

            case (int)ShareResultCode.kShareNetworkError:            //分享网络出错回调
                break;

            default:
                break;
            }
        }
Exemplo n.º 6
0
        public void login(Dictionary <string, string> info)
        {
            string text = AnySDKUtil.dictionaryToString(info);

            Debug.Log("login   " + text);
            AnySDKUser.AnySDKUser_nativeLoginWithMap(text);
        }
Exemplo n.º 7
0
        /**
         * @brief set pListener The callback object for social result
         * @param the MonoBehaviour object
         * @param the callback of function
         */

        public void setListener(MonoBehaviour gameObject, string functionName)
        {
#if !UNITY_EDITOR && UNITY_ANDROID
            AnySDKUtil.registerActionCallback(AnySDKType.Social, gameObject, functionName);
#else
            Debug.Log("This platform does not support!");
#endif
        }
Exemplo n.º 8
0
        public List <string> getPluginId()
        {
            StringBuilder stringBuilder = new StringBuilder();

            stringBuilder.Capacity = 1024;
            AnySDKIAP.AnySDKIAP_nativeGetPluginId(stringBuilder);
            return(AnySDKUtil.StringToList(stringBuilder.ToString()));
        }
Exemplo n.º 9
0
 public AnySDKParam(Dictionary <string, string> nValue)
 {
     _intValue    = 0;
     _floatValue  = 0;
     _boolValue   = false;
     _strValue    = null;
     _strMapValue = AnySDKUtil.dictionaryToString(nValue);
     _type        = ParamType.kParamTypeStringMap;
 }
Exemplo n.º 10
0
        /**
         *@brief del tag
         *@param tags
         *@return void
         */

        public void delTags(List <string> tags)
        {
#if !UNITY_EDITOR && ( UNITY_ANDROID )
            string value = AnySDKUtil.ListToString(tags);
            AnySDKPush_nativeDelTags(value);
#else
            Debug.Log("This platform does not support!");
#endif
        }
Exemplo n.º 11
0
        /**
         * @brief pay for product
         * @param info The info of product, must contains key:
         * @warning  Look at the manual of plugins.
         *
         */

        public void payForProduct(Dictionary <string, string> info, string pluginId = "")
        {
#if !UNITY_EDITOR && (UNITY_ANDROID || UNITY_IOS)
            string value = AnySDKUtil.dictionaryToString(info);
            AnySDKIAP_nativePayForProduct(value, pluginId);
#else
            Debug.Log("This platform does not support!");
#endif
        }
Exemplo n.º 12
0
        /**
         * @brief methods of achievement feature
         * @param the info of achievement
         */

        public void unlockAchievement(Dictionary <string, string> achInfo)
        {
#if !UNITY_EDITOR && ( UNITY_ANDROID )
            string info = AnySDKUtil.dictionaryToString(achInfo);
            AnySDKSocial_nativeUnlockAchievement(info);
#else
            Debug.Log("This platform does not support!");
#endif
        }
Exemplo n.º 13
0
 public AnySDKParam(Dictionary <string, string> nValue)
 {
     this._intValue    = 0;
     this._floatValue  = 0f;
     this._boolValue   = false;
     this._strValue    = null;
     this._strMapValue = AnySDKUtil.dictionaryToString(nValue);
     this._type        = AnySDKParam.ParamType.kParamTypeStringMap;
 }
Exemplo n.º 14
0
        /**
         *@brief set tag
         *@param tags
         *@return void
         */

        public void setTags(List <string> tags)
        {
#if UNITY_ANDROID || UNITY_IOS
            string value = AnySDKUtil.ListToString(tags);
            AnySDKPush_nativeSetTags(value);
#else
            Debug.Log("This platform does not support!");
#endif
        }
Exemplo n.º 15
0
        /**
         * @brief User login
         *      if the process of logining need to know  the parameters ,
         *      you can use the function
         * @param the parameters
         */
        public void login(Dictionary <string, string> info)
        {
#if !UNITY_EDITOR && ( UNITY_ANDROID )
            string sInfo = AnySDKUtil.dictionaryToString(info);
            Debug.Log("login   " + sInfo);
            AnySDKUser_nativeLoginWithMap(sInfo);
#else
            Debug.Log("This platform does not support!");
#endif
        }
Exemplo n.º 16
0
        /**
         *
         * @Title: onPay
         * @Description: Call this method if you want to track pay events as happening during a section.
         * @param  productInfo  The details of this parameters are already covered by document.
         * @return void
         */

        public void onPay(Dictionary <string, string> userInfo)
        {
#if !UNITY_EDITOR && ( UNITY_ANDROID )
            string info = AnySDKUtil.dictionaryToString(userInfo);
            Debug.Log("onPay   " + info);
            AnySDKAdTracking_nativeOnPay(info);
#else
            Debug.Log("This platform does not support!");
#endif
        }
Exemplo n.º 17
0
        /**
         * @brief share information
         * @param info The info of share, contains key:
         * @warning Look at the manual of plugins.
         *
         */

        public void share(Dictionary <string, string> shareInfo)
        {
#if UNITY_ANDROID || UNITY_IOS
            string info = AnySDKUtil.dictionaryToString(shareInfo);
            Debug.Log("share   " + info);
            AnySDKShare_nativeShare(info);
#else
            Debug.Log("This platform does not support!");
#endif
        }
Exemplo n.º 18
0
        /**
         * @brief set pListener The callback object for share result
         * @param the MonoBehaviour object
         * @param the callback of function
         */

        public void setListener(MonoBehaviour gameObject, string functionName)
        {
#if UNITY_ANDROID
            AnySDKUtil.registerActionCallback(AnySDKType.Share, gameObject, functionName);
#elif UNITY_IOS
            string gameObjectName = gameObject.gameObject.name;
            AnySDKShare_nativeSetListener(gameObjectName, functionName);
#else
            Debug.Log("This platform does not support!");
#endif
        }
Exemplo n.º 19
0
        private void SocialExternalCall(string msg)
        {
            Debug.Log("SocialExternalCall(" + msg + ")");
            Dictionary <string, string> dictionary = AnySDKUtil.stringToDictionary(msg);
            int    num  = Convert.ToInt32(dictionary["code"]);
            string text = dictionary["msg"];

            switch (num)
            {
            }
        }
Exemplo n.º 20
0
        private void PushExternalCall(string msg)
        {
            Debug.Log("PushExternalCall(" + msg + ")");
            Dictionary <string, string> dictionary = AnySDKUtil.stringToDictionary(msg);
            int    num  = Convert.ToInt32(dictionary["code"]);
            string text = dictionary["msg"];
            int    num2 = num;

            if (num2 != 0)
            {
            }
        }
Exemplo n.º 21
0
        void RECExternalCall(string msg)
        {
            Debug.Log("RECExternalCall(" + msg + ")");
            Dictionary <string, string> dic = AnySDKUtil.stringToDictionary(msg);
            int    code   = Convert.ToInt32(dic["code"]);
            string result = dic["msg"];

            switch (code)
            {
            case (int)RECResultCode.kRECInitSuccess:            //初始化成功
                Debug.Log("kRECInitSuccess\n");
                break;

            case (int)RECResultCode.kRECInitFail:            //初始化失败
                Debug.Log("kRECInitFail\n");
                break;

            case (int)RECResultCode.kRECStartRecording:            //开始录制
                Debug.Log("kRECStartRecording \n");
                break;

            case (int)RECResultCode.kRECStopRecording:            //结束录制
                Debug.Log("kRECStopRecording \n");
                break;

            case (int)RECResultCode.kRECPauseRecording:            //暂停录制
                Debug.Log("kRECPauseRecording \n");
                break;

            case (int)RECResultCode.kRECResumeRecording:            //恢复录制
                Debug.Log("kRECResumeRecording \n");
                break;

            case (int)RECResultCode.kRECEnterSDKPage:            //进入SDK页面
                Debug.Log("kRECEnterSDKPage \n");
                break;

            case (int)RECResultCode.kRECQuitSDKPage:            //退出SDK页面
                Debug.Log("kRECQuitSDKPage \n");
                break;

            case (int)RECResultCode.kRECShareSuccess:            //视频分享成功
                Debug.Log("kRECShareSuccess \n");
                break;

            case (int)RECResultCode.kRECShareFail:            //视频分享失败
                Debug.Log("kRECShareFail \n");
                break;

            default:
                break;
            }
        }
Exemplo n.º 22
0
        /**
         * @brief get plugin ids
         * @return List<string> the plugin ids
         */

        public List <string> getPluginId()
        {
#if !UNITY_EDITOR && (UNITY_ANDROID || UNITY_IOS)
            StringBuilder value = new StringBuilder();
            value.Capacity = AnySDKUtil.MAX_CAPACITY_NUM;
            AnySDKIAP_nativeGetPluginId(value);
            List <string> list = AnySDKUtil.StringToList(value.ToString());
            return(list);
#else
            Debug.Log("This platform does not support!");
            return(null);
#endif
        }
Exemplo n.º 23
0
        public void logEvent(string eventId, Dictionary <string, string> paramMap = null)
        {
            string message;

            if (paramMap == null)
            {
                message = null;
            }
            else
            {
                message = AnySDKUtil.dictionaryToString(paramMap);
            }
            AnySDKAnalytics.AnySDKAnalytics_nativeLogEvent(eventId, message);
        }
Exemplo n.º 24
0
        public void trackEvent(string eventId, Dictionary <string, string> paramMap = null)
        {
            string message;

            if (paramMap == null)
            {
                message = null;
            }
            else
            {
                message = AnySDKUtil.dictionaryToString(paramMap);
            }
            AnySDKAdTracking.AnySDKAdTracking_nativeTrackEvent(eventId, message);
        }
Exemplo n.º 25
0
        private void RECExternalCall(string msg)
        {
            Debug.Log("RECExternalCall(" + msg + ")");
            Dictionary <string, string> dictionary = AnySDKUtil.stringToDictionary(msg);
            int    num  = Convert.ToInt32(dictionary["code"]);
            string text = dictionary["msg"];

            switch (num)
            {
            case 0:
                Debug.Log("kRECInitSuccess\n");
                break;

            case 1:
                Debug.Log("kRECInitFail\n");
                break;

            case 2:
                Debug.Log("kRECStartRecording \n");
                break;

            case 3:
                Debug.Log("kRECStopRecording \n");
                break;

            case 4:
                Debug.Log("kRECPauseRecording \n");
                break;

            case 5:
                Debug.Log("kRECResumeRecording \n");
                break;

            case 6:
                Debug.Log("kRECEnterSDKPage \n");
                break;

            case 7:
                Debug.Log("kRECQuitSDKPage \n");
                break;

            case 8:
                Debug.Log("kRECShareSuccess \n");
                break;

            case 9:
                Debug.Log("kRECShareFail \n");
                break;
            }
        }
Exemplo n.º 26
0
        private void IAPExternalCall(string msg)
        {
            Debug.Log("IAPExternalCall(" + msg + ")");
            Dictionary <string, string> dictionary = AnySDKUtil.stringToDictionary(msg);
            int    num  = Convert.ToInt32(dictionary["code"]);
            string text = dictionary["msg"];

            switch (num)
            {
            case 0:
                Debug.Log("IAPExternalCall(" + this._instance.getOrderId(this._instance.getPluginId()[0]) + ")");
                break;
            }
        }
Exemplo n.º 27
0
        void PushExternalCall(string msg)
        {
            Debug.Log("PushExternalCall(" + msg + ")");
            Dictionary <string, string> dic = AnySDKUtil.stringToDictionary(msg);
            int    code   = Convert.ToInt32(dic["code"]);
            string result = dic["msg"];

            switch (code)
            {
            case (int)PushActionResultCode.kPushReceiveMessage:            //Push接受到消息回调
                break;

            default:
                break;
            }
        }
Exemplo n.º 28
0
        /**
         * @brief log an event.
         * @param eventId The identity of event
         * @param paramMap Extern parameters of the event, use NULL if not needed.
         */

        public void  logEvent(string errorId, Dictionary <string, string> paramMap = null)
        {
#if UNITY_ANDROID || UNITY_IOS
            string value;
            if (paramMap == null)
            {
                value = null;
            }
            else
            {
                value = AnySDKUtil.dictionaryToString(paramMap);
            }
            AnySDKAnalytics_nativeLogEvent(errorId, value);
#else
            Debug.Log("This platform does not support!");
#endif
        }
Exemplo n.º 29
0
        /**
         *
         * @Title: trackEvent
         * @Description: Call this method if you want to track custom events with parameters as happening during a section.
         * @param eventId The custom event name.
         * @param  paramMap The details of this parameters are already covered by document.
         */
        public void  trackEvent(string eventId, Dictionary <string, string> paramMap = null)
        {
#if !UNITY_EDITOR && ( UNITY_ANDROID )
            string value;
            if (paramMap == null)
            {
                value = null;
            }
            else
            {
                value = AnySDKUtil.dictionaryToString(paramMap);
            }
            AnySDKAdTracking_nativeTrackEvent(eventId, value);
#else
            Debug.Log("This platform does not support!");
#endif
        }
Exemplo n.º 30
0
        void AdsExternalCall(string msg)
        {
            Debug.Log("AdsExternalCall(" + msg + ")");
            Dictionary <string, string> dic = AnySDKUtil.stringToDictionary(msg);
            int    code   = Convert.ToInt32(dic["code"]);
            string result = dic["msg"];

            switch (code)
            {
            case (int)AdsResultCode.kAdsReceived:            //广告接受成功回调
                break;

            case (int)AdsResultCode.kAdsShown:            //广告展示回调
                break;

            case (int)AdsResultCode.kAdsDismissed:            //广告消失回调

                break;

            case (int)AdsResultCode.kPointsSpendSucceed:            //积分设置成功回调

                break;

            case (int)AdsResultCode.kPointsSpendFailed:            //积分设置失败回调

                break;

            case (int)AdsResultCode.kNetworkError:            //网络错误回调

                break;

            case (int)AdsResultCode.kUnknownError:            //未知错误回调

                break;

            case (int)AdsResultCode.kOfferWallOnPointsChanged:            //积分改变回调

                break;

            default:
                break;
            }
        }