Exemplo n.º 1
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");
            }
            if (!IsInitialized())
            {
                return(AnalyticsResult.NotInitialized);
            }
            if (eventData == null)
            {
                return(SendCustomEventName(customEventName));
            }
            CustomEventData customEvent = new CustomEventData(customEventName);
            AnalyticsResult result      = AnalyticsResult.InvalidData;

            try
            {
                customEvent.AddDictionary(eventData);
                result = SendCustomEvent(customEvent);
            }
            finally
            {
                customEvent.Dispose();
            }
            return(result);
        }
Exemplo n.º 2
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);
        }
Exemplo n.º 3
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 = Analytics.GetUnityAnalyticsHandler();
            AnalyticsResult       result;

            if (unityAnalyticsHandler == null)
            {
                result = AnalyticsResult.NotInitialized;
            }
            else if (eventData == null)
            {
                result = unityAnalyticsHandler.CustomEvent(customEventName);
            }
            else
            {
                CustomEventData customEventData = new CustomEventData(customEventName);
                customEventData.Add(eventData);
                result = unityAnalyticsHandler.CustomEvent(customEventData);
            }
            return(result);
        }
        private void Destroy()
        {
            bool flag = this.m_Ptr != IntPtr.Zero;

            if (flag)
            {
                CustomEventData.Internal_Destroy(this.m_Ptr);
                this.m_Ptr = IntPtr.Zero;
            }
        }
Exemplo n.º 5
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 customEventData = new CustomEventData(customEventName);

            customEventData.Add("x", (double)Convert.ToDecimal(position.x));
            customEventData.Add("y", (double)Convert.ToDecimal(position.y));
            customEventData.Add("z", (double)Convert.ToDecimal(position.z));
            return(unityAnalyticsHandler.CustomEvent(customEventData));
        }
Exemplo n.º 6
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);
        }
Exemplo n.º 7
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));
        }
Exemplo n.º 8
0
        public static AnalyticsResult CustomEvent(string customEventName, IDictionary <string, object> eventData)
        {
            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
            {
                bool flag3 = eventData == null;
                if (flag3)
                {
                    result = Analytics.SendCustomEventName(customEventName);
                }
                else
                {
                    CustomEventData customEventData = new CustomEventData(customEventName);
                    AnalyticsResult analyticsResult = AnalyticsResult.InvalidData;
                    try
                    {
                        customEventData.AddDictionary(eventData);
                        analyticsResult = Analytics.SendCustomEvent(customEventData);
                    }
                    finally
                    {
                        customEventData.Dispose();
                    }
                    result = analyticsResult;
                }
            }
            return(result);
        }
Exemplo n.º 9
0
 public extern AnalyticsResult SendCustomEvent(CustomEventData eventData);
Exemplo n.º 10
0
 private static extern AnalyticsResult SendCustomEvent(CustomEventData eventData);
Exemplo n.º 11
0
 public AnalyticsResult CustomEvent(CustomEventData eventData)
 {
     return(this.SendCustomEvent(eventData));
 }
 internal static extern IntPtr Internal_Create(CustomEventData ced, string name);
 public CustomEventData(string name)
 {
     this.m_Ptr = CustomEventData.Internal_Create(this, name);
 }
Exemplo n.º 14
0
 public AnalyticsResult CustomEvent(CustomEventData eventData) =>
 this.SendCustomEvent(eventData);