Ejemplo n.º 1
0
        public void OnGUI()
        {
            eventName = EditorGUILayout.TextField("Event Name", eventName);

            EditorGUILayout.BeginHorizontal();
            GUILayout.Label("Event Type", GUILayout.Width(145));
            eventTypeIndex = EditorGUILayout.Popup(eventTypeIndex, MyEventType.typeList.ToArray());
            EditorGUILayout.EndHorizontal();

            DrawValueProperty(typeIndex);

            if (GUILayout.Button("Send Event"))
            {
                var    eventData = TypeUtils.ChangeType(value, MyPreferredType.Find(typeIndex));
                string eventKey  = MyEventType.typeList[eventTypeIndex];
                string eventType = MyEventType.typeDict[eventKey];

                if (string.Equals("Default", eventType))
                {
                    EventSender.SendGlobalEvent(eventName, eventData);
                }
                else
                {
                    EventSender.Dispatch(eventType, eventName, eventData);
                }
            }
        }