Пример #1
0
        internal static void TrackEvent(string title, string eventValue)
        {
            GetLocalIPAddressString();
            if (ipAdress != null)
            {
                string request = "http://in.getclicky.com/in.php?" +
                                 "site_id=" + ClickySiteID +                     //click site id , found in preferences
                                 "&sitekey_admin=" + ClickySiteAdminKey +        //clicky site admin key, found in preferences
                                 "&ip_address=" + ipAdress +                     //ip address of the user - used for mapping action trails
                                 "&type=custom" +
                                 "&href=" + "/" + eventValue.Replace(" ", "_") + //string that contains whatever event you want to track/log
                                 "&title=" + UnityEngine.WWW.EscapeURL(title) +
                                 "&type=click";

                wwwCall = new DelayedCall();
                EditorCoroutine.StartCoroutine(wwwCall.WWW(request), wwwCall);
            }
        }
Пример #2
0
        internal static string GetLocalIPAddressString()
        {
            if (ipAdress == null)
            {
                wwwIPCall             = new DelayedCall();
                wwwIPCall.wwwCallback = delegate(WWW obj)
                {
                    if (!string.IsNullOrEmpty(obj.text))
                    {
                        EditorPrefs.SetString(LAST_IP_ADDRESS_KEY, ipAdress);
                        ipAdress = obj.text;
                    }
                };
                EditorCoroutine.StartCoroutine(wwwIPCall.WWW("https://api.ipify.org"), wwwIPCall);

                if (EditorPrefs.HasKey(LAST_IP_ADDRESS_KEY))
                {
                    return(EditorPrefs.GetString(LAST_IP_ADDRESS_KEY));
                }
            }

            return(ipAdress);
        }
 internal static string GetLocalIPAddressString()
 {
     if(ipAdress == null)
     {
         wwwIPCall = new DelayedCall();
         wwwIPCall.wwwCallback = delegate(WWW obj) 
         {
             if(!string.IsNullOrEmpty(obj.text))
             {
                 EditorPrefs.SetString(LAST_IP_ADDRESS_KEY, ipAdress);
                 ipAdress = obj.text;
             }
         };
         EditorCoroutine.StartCoroutine(wwwIPCall.WWW("https://api.ipify.org"), wwwIPCall);
         
         if(EditorPrefs.HasKey(LAST_IP_ADDRESS_KEY))
         {
             return EditorPrefs.GetString(LAST_IP_ADDRESS_KEY);
         }
     }       
     
     return ipAdress;
 }
 internal static void TrackEvent(string title, string eventValue)
 {
     GetLocalIPAddressString();
     if(ipAdress != null)
     {
         string request = "http://in.getclicky.com/in.php?" +
             "site_id=" + ClickySiteID +  //click site id , found in preferences
                 "&sitekey_admin=" + ClickySiteAdminKey + //clicky site admin key, found in preferences
                 "&ip_address=" + ipAdress + //ip address of the user - used for mapping action trails
                 "&type=custom" +
                 "&href=" + "/"+eventValue.Replace(" ", "_") + //string that contains whatever event you want to track/log
                 "&title="+UnityEngine.WWW.EscapeURL(title)+
                 "&type=click";
         
         wwwCall = new DelayedCall();
         EditorCoroutine.StartCoroutine(wwwCall.WWW(request), wwwCall);
     }
 }