Пример #1
0
 public static AnySDKAnalytics getInstance()
 {
     if( null == _instance ) {
         _instance = new AnySDKAnalytics();
     }
     return _instance;
 }
Пример #2
0
        public float callFloatFuncWithParam(string functionName, AnySDKParam param)
        {
            List <AnySDKParam> list = new List <AnySDKParam>();

            list.Add(param);
            return(AnySDKAnalytics.AnySDKAnalytics_nativeCallFloatFuncWithParam(functionName, list.ToArray(), list.Count));
        }
Пример #3
0
        public void callFuncWithParam(string functionName, AnySDKParam param)
        {
            List <AnySDKParam> list = new List <AnySDKParam>();

            list.Add(param);
            AnySDKAnalytics.AnySDKAnalytics_nativeCallFuncWithParam(functionName, list.ToArray(), list.Count);
        }
Пример #4
0
 private static AnySDKAnalytics instance()
 {
     if (null == _instance)
     {
         _instance = new AnySDKAnalytics();
     }
     return(_instance);
 }
Пример #5
0
 public static AnySDKAnalytics getInstance()
 {
     if (null == _instance)
     {
         _instance = new AnySDKAnalytics();
     }
     return(_instance);
 }
Пример #6
0
 public static AnySDKAnalytics getInstance()
 {
     if (AnySDKAnalytics._instance == null)
     {
         AnySDKAnalytics._instance = new AnySDKAnalytics();
     }
     return(AnySDKAnalytics._instance);
 }
Пример #7
0
        public string getSDKVersion()
        {
            StringBuilder stringBuilder = new StringBuilder();

            stringBuilder.Capacity = 1024;
            AnySDKAnalytics.AnySDKAnalytics_nativeGetSDKVersion(stringBuilder);
            return(stringBuilder.ToString());
        }
Пример #8
0
 public bool callBoolFuncWithParam(string functionName, List <AnySDKParam> param = null)
 {
     if (param == null)
     {
         return(AnySDKAnalytics.AnySDKAnalytics_nativeCallBoolFuncWithParam(functionName, null, 0));
     }
     return(AnySDKAnalytics.AnySDKAnalytics_nativeCallBoolFuncWithParam(functionName, param.ToArray(), param.Count));
 }
Пример #9
0
        /**
         * 实现在应用程序中埋点来统计用户的点击行为
         */
        void logEvent()
        {
            Dictionary <string, string> dic = new Dictionary <string, string>();

            dic["100"]  = "Page1 open";
            dic["角色名称"] = "yonghu";
            dic["登陆时间"] = "2014";
            AnySDKAnalytics.getInstance().logEvent("10", dic);
        }
Пример #10
0
        void failTask()
        {
            Dictionary <string, string> paramMap = new Dictionary <string, string>();

            paramMap["Task_Id"]     = "123456";
            paramMap["Fail_Reason"] = "test";
            AnySDKParam param = new AnySDKParam(paramMap);

            AnySDKAnalytics.getInstance().callFuncWithParam("failTask", param);
        }
Пример #11
0
        private void startLevel()
        {
            Dictionary <string, string> dictionary = new Dictionary <string, string>();

            dictionary["Level_Id"] = "123456";
            dictionary["Seq_Num"]  = "1";
            AnySDKParam param = new AnySDKParam(dictionary);

            AnySDKAnalytics.getInstance().callFuncWithParam("startLevel", param);
        }
Пример #12
0
        void startLevel()
        {
            Dictionary <string, string> paramMap = new Dictionary <string, string>();

            paramMap["Level_Id"] = "123456";
            paramMap["Seq_Num"]  = "1";
            AnySDKParam param = new AnySDKParam(paramMap);

            AnySDKAnalytics.getInstance().callFuncWithParam("startLevel", param);
        }
Пример #13
0
        void onChargeFail()
        {
            Dictionary <string, string> paramMap = new Dictionary <string, string>();

            paramMap["Order_Id"]    = "123456";
            paramMap["Fail_Reason"] = "test";
            AnySDKParam param = new AnySDKParam(paramMap);

            AnySDKAnalytics.getInstance().callFuncWithParam("onChargeFail", param);
        }
Пример #14
0
        private void failTask()
        {
            Dictionary <string, string> dictionary = new Dictionary <string, string>();

            dictionary["Task_Id"]     = "123456";
            dictionary["Fail_Reason"] = "test";
            AnySDKParam param = new AnySDKParam(dictionary);

            AnySDKAnalytics.getInstance().callFuncWithParam("failTask", param);
        }
Пример #15
0
        private void startTask()
        {
            Dictionary <string, string> dictionary = new Dictionary <string, string>();

            dictionary["Task_Id"]   = "123456";
            dictionary["Task_Type"] = Convert.ToString(0);
            AnySDKParam param = new AnySDKParam(dictionary);

            AnySDKAnalytics.getInstance().callFuncWithParam("startTask", param);
        }
Пример #16
0
        void startTask()
        {
            Dictionary <string, string> paramMap = new Dictionary <string, string>();

            paramMap["Task_Id"]   = "123456";
            paramMap["Task_Type"] = Convert.ToString((int)TaskType.GUIDE_LINE);
            AnySDKParam param = new AnySDKParam(paramMap);

            AnySDKAnalytics.getInstance().callFuncWithParam("startTask", param);
        }
Пример #17
0
        void OnGUI()
        {
            GUI.color = Color.white;

            GUI.skin.button.fontSize = 30;
            if (GUI.Button(new Rect(5, 5, Screen.width - 10, 70), "startSession"))
            {
                AnySDKAnalytics.getInstance().setDebugMode(true);
                startSession();
            }

            if (GUI.Button(new Rect(5, 80, Screen.width - 10, 70), "stopSession"))
            {
                stopSession();
            }

            if (GUI.Button(new Rect(5, 155, Screen.width - 10, 70), "setSessionContinueMillis"))
            {
                setSessionContinueMillis();
            }

            if (GUI.Button(new Rect(5, 230, Screen.width - 10, 70), "logError"))
            {
                logError();
            }


            if (GUI.Button(new Rect(5, 305, Screen.width - 10, 70), "logEvent"))
            {
                logEvent();
            }


            if (GUI.Button(new Rect(5, 380, Screen.width - 10, 70), "logTimedEventBegin"))
            {
                logTimedEventBegin();
            }


            if (GUI.Button(new Rect(5, 455, Screen.width - 10, 70), "logTimedEventEnd"))
            {
                logTimedEventEnd();
            }

            if (GUI.Button(new Rect(5, 530, Screen.width - 10, 70), "setCaptureUncaughtException"))
            {
                setCaptureUncaughtException( );
            }

            if (GUI.Button(new Rect(5, 605, Screen.width - 10, 70), "return"))
            {
                Destroy(GetComponent("TestAnalyticsPlugin"));
                this.gameObject.AddComponent("Test");
            }
        }
Пример #18
0
        public string callStringFuncWithParam(string functionName, AnySDKParam param)
        {
            List <AnySDKParam> list = new List <AnySDKParam>();

            list.Add(param);
            StringBuilder stringBuilder = new StringBuilder();

            stringBuilder.Capacity = 1024;
            AnySDKAnalytics.AnySDKAnalytics_nativeCallStringFuncWithParam(functionName, list.ToArray(), list.Count, stringBuilder);
            return(stringBuilder.ToString());
        }
Пример #19
0
 public void callFuncWithParam(string functionName, List <AnySDKParam> param = null)
 {
     if (param == null)
     {
         AnySDKAnalytics.AnySDKAnalytics_nativeCallFuncWithParam(functionName, null, 0);
     }
     else
     {
         AnySDKAnalytics.AnySDKAnalytics_nativeCallFuncWithParam(functionName, param.ToArray(), param.Count);
     }
 }
Пример #20
0
        private void onUse()
        {
            Dictionary <string, string> dictionary = new Dictionary <string, string>();

            dictionary["Item_Id"]    = "123456";
            dictionary["Item_Type"]  = "test";
            dictionary["Item_Count"] = Convert.ToString(2);
            dictionary["Use_Reason"] = "1";
            AnySDKParam param = new AnySDKParam(dictionary);

            AnySDKAnalytics.getInstance().callFuncWithParam("onUse", param);
        }
Пример #21
0
        void onReward()
        {
            Dictionary <string, string> paramMap = new Dictionary <string, string>();

            paramMap["Item_Id"]    = "123456";
            paramMap["Item_Type"]  = "test";
            paramMap["Item_Count"] = Convert.ToString(2);
            paramMap["Use_Reason"] = "1";
            AnySDKParam param = new AnySDKParam(paramMap);

            AnySDKAnalytics.getInstance().callFuncWithParam("onReward", param);
        }
Пример #22
0
        void onPurchase()
        {
            Dictionary <string, string> paramMap = new Dictionary <string, string>();

            paramMap["Item_Id"]          = "123456";
            paramMap["Item_Type"]        = "test";
            paramMap["Item_Count"]       = Convert.ToString(2);
            paramMap["Virtual_Currency"] = "1";
            paramMap["Currency_Type"]    = AnySDK.getInstance().getChannelId();
            AnySDKParam param = new AnySDKParam(paramMap);

            AnySDKAnalytics.getInstance().callFuncWithParam("onPurchase", param);
        }
Пример #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);
        }
Пример #24
0
        void onChargeOnlySuccess()
        {
            Dictionary <string, string> paramMap = new Dictionary <string, string>();

            paramMap["Order_Id"]                = "123456";
            paramMap["Product_Name"]            = "test";
            paramMap["Currency_Amount"]         = Convert.ToString(2.0);
            paramMap["Currency_Type"]           = "1";
            paramMap["Payment_Type"]            = "1";
            paramMap["Virtual_Currency_Amount"] = Convert.ToString(100);
            AnySDKParam param = new AnySDKParam(paramMap);

            AnySDKAnalytics.getInstance().callFuncWithParam("onChargeOnlySuccess", param);
        }
Пример #25
0
        private void onChargeRequest()
        {
            Dictionary <string, string> dictionary = new Dictionary <string, string>();

            dictionary["Order_Id"]                = "123456";
            dictionary["Product_Name"]            = "test";
            dictionary["Currency_Amount"]         = Convert.ToString(2.0);
            dictionary["Currency_Type"]           = "1";
            dictionary["Payment_Type"]            = "1";
            dictionary["Virtual_Currency_Amount"] = Convert.ToString(100);
            AnySDKParam param = new AnySDKParam(dictionary);

            AnySDKAnalytics.getInstance().callFuncWithParam("onChargeRequest", param);
        }
Пример #26
0
        public string callStringFuncWithParam(string functionName, List <AnySDKParam> param = null)
        {
            StringBuilder stringBuilder = new StringBuilder();

            stringBuilder.Capacity = 1024;
            if (param == null)
            {
                AnySDKAnalytics.AnySDKAnalytics_nativeCallStringFuncWithParam(functionName, null, 0, stringBuilder);
            }
            else
            {
                AnySDKAnalytics.AnySDKAnalytics_nativeCallStringFuncWithParam(functionName, param.ToArray(), param.Count, stringBuilder);
            }
            return(stringBuilder.ToString());
        }
Пример #27
0
        void setAccount()
        {
            Dictionary <string, string> paramMap = new Dictionary <string, string>();

            paramMap["Account_Id"]      = "123";
            paramMap["Account_Name"]    = "test";
            paramMap["Account_Type"]    = Convert.ToString((int)AccountType.ANONYMOUS);
            paramMap["Account_Level"]   = "1";
            paramMap["Account_Age"]     = "1";
            paramMap["Account_Operate"] = Convert.ToString((int)AccountOperate.LOGIN);
            paramMap["Account_Gender"]  = Convert.ToString((int)AccountGender.MALE);
            paramMap["Server_Id"]       = "1";
            AnySDKParam param = new AnySDKParam(paramMap);

            AnySDKAnalytics.getInstance().callFuncWithParam("setAccount", param);
        }
Пример #28
0
        private void setAccount()
        {
            Dictionary <string, string> dictionary = new Dictionary <string, string>();

            dictionary["Account_Id"]      = "123";
            dictionary["Account_Name"]    = "test";
            dictionary["Account_Type"]    = Convert.ToString(0);
            dictionary["Account_Level"]   = "1";
            dictionary["Account_Age"]     = "1";
            dictionary["Account_Operate"] = Convert.ToString(0);
            dictionary["Account_Gender"]  = Convert.ToString(0);
            dictionary["Server_Id"]       = "1";
            AnySDKParam param = new AnySDKParam(dictionary);

            AnySDKAnalytics.getInstance().callFuncWithParam("setAccount", param);
        }
Пример #29
0
 private void OnGUI()
 {
     GUI.color = Color.white;
     GUI.skin.button.fontSize = 30;
     if (GUI.Button(new Rect(5f, 5f, (float)(Screen.width - 10), 70f), "startSession"))
     {
         AnySDKAnalytics.getInstance().setDebugMode(true);
         this.startSession();
     }
     if (GUI.Button(new Rect(5f, 80f, (float)(Screen.width - 10), 70f), "stopSession"))
     {
         this.stopSession();
     }
     if (GUI.Button(new Rect(5f, 155f, (float)(Screen.width - 10), 70f), "setSessionContinueMillis"))
     {
         this.setSessionContinueMillis();
     }
     if (GUI.Button(new Rect(5f, 230f, (float)(Screen.width - 10), 70f), "logError"))
     {
         this.logError();
     }
     if (GUI.Button(new Rect(5f, 305f, (float)(Screen.width - 10), 70f), "logEvent"))
     {
         this.logEvent();
     }
     if (GUI.Button(new Rect(5f, 380f, (float)(Screen.width - 10), 70f), "logTimedEventBegin"))
     {
         this.logTimedEventBegin();
     }
     if (GUI.Button(new Rect(5f, 455f, (float)(Screen.width - 10), 70f), "logTimedEventEnd"))
     {
         this.logTimedEventEnd();
     }
     if (GUI.Button(new Rect(5f, 530f, (float)(Screen.width - 10), 70f), "setCaptureUncaughtException"))
     {
         this.setCaptureUncaughtException();
     }
     if (GUI.Button(new Rect(5f, 605f, (float)(Screen.width - 10), 70f), "return"))
     {
         UnityEngine.Object.Destroy(base.GetComponent("TestAnalyticsPlugin"));
         base.gameObject.AddComponent("Test");
     }
 }
Пример #30
0
 public void setDebugMode(bool bDebug)
 {
     AnySDKAnalytics.AnySDKAnalytics_nativeSetDebugMode(bDebug);
 }
Пример #31
0
 public bool isFunctionSupported(string functionName)
 {
     return(AnySDKAnalytics.AnySDKAnalytics_nativeIsFunctionSupported(functionName));
 }