Exemplo n.º 1
0
        void CreateListener(ScriptableEvent _event)
        {
            EventListener listener = new EventListener
            {
                _Event = _event
            };

            eventSystem.listeners.Add(listener);
        }
Exemplo n.º 2
0
        public override void OnInspectorGUI()
        {
            DrawDefaultInspector();
            ScriptableEvent _event = (ScriptableEvent)target;

            if (GUILayout.Button("Raise"))
            {
                _event.Raise();
            }
        }
Exemplo n.º 3
0
 void DrawEventAssignment()
 {
     GUILayout.BeginVertical();
     GUILayout.Label("Add Event");
     assignedEvent = (ScriptableEvent)EditorGUILayout.ObjectField(
         assignedEvent, typeof(ScriptableEvent), false);
     if (GUILayout.Button("Add"))
     {
         if (assignedEvent)
         {
             CreateListener(assignedEvent);
             assignedEvent = null;
         }
     }
     GUILayout.EndVertical();
 }