Exemple #1
0
        public static AnalyticsResult CustomEvent(string customEventName, Vector3 position)
        {
            bool flag = string.IsNullOrEmpty(customEventName);

            if (flag)
            {
                throw new ArgumentException("Cannot set custom event name to an empty or null string");
            }
            bool            flag2 = !Analytics.IsInitialized();
            AnalyticsResult result;

            if (flag2)
            {
                result = AnalyticsResult.NotInitialized;
            }
            else
            {
                CustomEventData customEventData = new CustomEventData(customEventName);
                customEventData.AddDouble("x", (double)Convert.ToDecimal(position.x));
                customEventData.AddDouble("y", (double)Convert.ToDecimal(position.y));
                customEventData.AddDouble("z", (double)Convert.ToDecimal(position.z));
                AnalyticsResult analyticsResult = Analytics.SendCustomEvent(customEventData);
                customEventData.Dispose();
                result = analyticsResult;
            }
            return(result);
        }
Exemple #2
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));
        }
Exemple #3
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");
            }
            if (!IsInitialized())
            {
                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));
            var result = SendCustomEvent(customEvent);

            customEvent.Dispose();
            return(result);
        }