SendCustomEvent() private method

private SendCustomEvent ( CustomEventData eventData ) : AnalyticsResult
eventData CustomEventData
return AnalyticsResult
示例#1
0
        public static AnalyticsResult CustomEvent(string customEventName, Vector3 position)
        {
            if (string.IsNullOrEmpty(customEventName))
            {
                throw new ArgumentException("Cannot set custom event name to an empty or null string");
            }
            UnityAnalyticsHandler unityAnalyticsHandler = GetUnityAnalyticsHandler();

            if (unityAnalyticsHandler == null)
            {
                return(AnalyticsResult.NotInitialized);
            }
            CustomEventData customEvent = new CustomEventData(customEventName);

            customEvent.AddDouble("x", (double)System.Convert.ToDecimal(position.x));
            customEvent.AddDouble("y", (double)System.Convert.ToDecimal(position.y));
            customEvent.AddDouble("z", (double)System.Convert.ToDecimal(position.z));
            return(unityAnalyticsHandler.SendCustomEvent(customEvent));
        }
示例#2
0
        public static AnalyticsResult CustomEvent(string customEventName, IDictionary <string, object> eventData)
        {
            if (string.IsNullOrEmpty(customEventName))
            {
                throw new ArgumentException("Cannot set custom event name to an empty or null string");
            }
            UnityAnalyticsHandler unityAnalyticsHandler = GetUnityAnalyticsHandler();

            if (unityAnalyticsHandler == null)
            {
                return(AnalyticsResult.NotInitialized);
            }
            if (eventData == null)
            {
                return(unityAnalyticsHandler.SendCustomEventName(customEventName));
            }
            CustomEventData customEvent = new CustomEventData(customEventName);

            customEvent.AddDictionary(eventData);
            return(unityAnalyticsHandler.SendCustomEvent(customEvent));
        }