예제 #1
0
        /// <summary>
        ///   <param>Track an event (in EventName list)</param>
        /// </summary>
        /// <param name="eventName">Event name</param>
        /// <param name="data">Internal data</param>
        /// <param name="eventType">event type</param>
        /// <param name="customVariables">External data (set in game)</param>
        public static void TrackEvent(EventName eventName,
                                      string data      = null,
                                      string eventType = null,
                                      Dictionary <string, object> customVariables = null)
        {
            string customVariablesJson = null;

            if (customVariables != null)
            {
                customVariablesJson = AnalyticsUtil.ConvertDictionaryToCustomVarJson(customVariables);
            }

            InternalTrackEvent(eventName.ToString(), data, eventType, customVariablesJson);
        }
예제 #2
0
        /// <summary>
        ///   <param>Track an event</param>
        /// </summary>
        /// <param name="eventName">Event name</param>
        /// <param name="data">Internal data</param>
        /// <param name="eventType">event type</param>
        /// <param name="customVariables">External data (set in game)</param>
        private static void TrackEvent(string eventName,
                                       Dictionary <string, object> data,
                                       string eventType = null,
                                       Dictionary <string, object> customVariables = null)
        {
            string dataJson = null;

            if (data != null)
            {
                dataJson = AnalyticsUtil.ConvertDictionaryToJson(data);
            }

            string customVariablesJson = null;

            if (customVariables != null)
            {
                customVariablesJson = AnalyticsUtil.ConvertDictionaryToCustomVarJson(customVariables);
            }

            InternalTrackEvent(eventName, dataJson, eventType, customVariablesJson);
        }
예제 #3
0
 internal string ToJson()
 {
     return(AnalyticsUtil.ConvertDictionaryToJson(_values, _jsonData, _customVariablesData));
 }