void ShowEventNameTooltip(SerializedProperty property, Rect position)
        {
            if (eventType == k_CustomEvent)
            {
                return;
            }

            int index = Array.IndexOf(eventTypes, eventType);

            if (index < 0 || index >= EventPayloads.s_EventTypes.Length)
            {
                return;
            }

            Type t = EventPayloads.s_EventTypes [index];

            if (t != null)
            {
                AnalyticsEventTracker tracker = property.serializedObject.targetObject as AnalyticsEventTracker;
                tracker.payload.standardEventType = t;

                StandardEventName attr =
                    (StandardEventName)Attribute.GetCustomAttribute(t, typeof(StandardEventName));
                if (attr != null)
                {
                    string tooltip = (attr as StandardEventName).tooltip;
                    GUI.Box(position, new GUIContent("", tooltip), GUIStyle.none);
                }
            }
        }
Exemplo n.º 2
0
        void ConformEventType(SerializedProperty property, string eventType)
        {
            int  index = Array.IndexOf(eventTypes, eventType);
            Type t     = EventPayloads.s_EventTypes [index];

            if (t != null)
            {
                AnalyticsEventTracker tracker = property.serializedObject.targetObject as AnalyticsEventTracker;
                tracker.payload.standardEventType = t;

                StandardEventName attr =
                    (StandardEventName)Attribute.GetCustomAttribute(t, typeof(StandardEventName));
                if (attr != null)
                {
                    UpdateEventName(property, (attr as StandardEventName).sendName);
                }
            }
        }
Exemplo n.º 3
0
        void BuildEventTypes()
        {
            List <string> nameList = new List <string> ();

            for (int a = 0; a < EventPayloads.s_EventTypes.Length; a++)
            {
                Type t = EventPayloads.s_EventTypes [a];

                string            eventName          = t.Name;
                StandardEventName eventNameAttribute =
                    (StandardEventName)Attribute.GetCustomAttribute(t, typeof(StandardEventName));

                if (eventName != k_CustomEvent)
                {
                    eventName = String.Concat(eventNameAttribute.path, "/", t.Name);
                }

                nameList.Add(eventName);
            }
            eventTypes = nameList.ToArray();
        }