public override void ReportDesignEvent(string eventName, float eventValue)
        {
            var dictionary = new Dictionary <string, object>();

            dictionary.Add("value", eventValue);
            UnityAnalytics.CustomEvent("design." + eventName, dictionary);
        }
예제 #2
0
 public void SetUserID(string userId)
 {
     if (!string.IsNullOrEmpty(userId))
     {
         UnityAnalytics.SetUserId(userId);
     }
 }
        public override void ReportErrorEvent(ErrorSeverity severity, string message)
        {
            var dictionary = new Dictionary <string, object>();

            dictionary.Add("message", message);
            UnityAnalytics.CustomEvent("log." + severity, dictionary);
        }
        public override void ReportProgressionEvent(
            ProgressionStatus status,
            string p01,
            string p02,
            string p03,
            int score)
        {
            string eventName = "progression." + status;

            var dictionary = new Dictionary <string, object>
            {
                {
                    "progression01", p01
                },
                {
                    "score", score
                }
            };

            if (!string.IsNullOrEmpty(p02))
            {
                dictionary.Add("progression02", p02);
                if (!string.IsNullOrEmpty(p03))
                {
                    dictionary.Add("progression03", p03);
                }
            }

            UnityAnalytics.CustomEvent(eventName, dictionary);
        }
        public override void ReportResourceEvent(
            ResourceType type,
            string currency,
            float amount,
            string itemType,
            string itemId)
        {
            string eventNameFormat = "resource.{0}";
            string eventName       = string.Format(eventNameFormat, type);
            var    dictionary      = new Dictionary <string, object>
            {
                {
                    "currency", currency
                },
                {
                    "amount", amount
                },
                {
                    "itemType", itemType
                },
                {
                    "itemId", itemId
                }
            };

            UnityAnalytics.CustomEvent(eventName, dictionary);
        }
예제 #6
0
        public void LogEvent(string action, Dictionary <string, string> parameters)
        {
            var objectParameters = new  Dictionary <string, object>(parameters.Count);

            foreach (var parameter in parameters)
            {
                objectParameters.Add(parameter.Key, parameter.Value);
            }
            UnityAnalytics.CustomEvent(action, objectParameters);
        }
        public override void ReportBusinessEvent(
            string currency,
            int amount,
            string itemType,
            string itemId,
            string cartType,
            string receipt,
            string signature)
        {
            string productId = cartType + "." + itemType + "." + itemId;

            UnityAnalytics.Transaction(productId, amount, currency, receipt, signature);
        }
예제 #8
0
 public void LogAnalyticsCustomEvent()
 {
     if (m_parametersName.Length > 0)
     {
         var parameters = new System.Collections.Generic.Dictionary <string, object>(m_parametersName.Length);
         for (int i = 0; i < m_parametersName.Length; i++)
         {
             parameters.Add(m_parametersName[i], parametersValue[i]);
         }
         Analytics.CustomEvent(m_eventName, parameters);
     }
     else
     {
         Analytics.CustomEvent(m_eventName);
     }
 }
예제 #9
0
 public void LogEvent(string action)
 {
     UnityAnalytics.CustomEvent(action);
 }