using UnityEditor; using UnityEngine; namespace UnityAtoms { public class GameEventEditor : Editor where E : GameEvent { public override void OnInspectorGUI() { base.OnInspectorGUI(); GUI.enabled = Application.isPlaying; E e = target as E; if (GUILayout.Button("Raise")) { e.Raise(default(T)); } } } [CustomEditor(typeof(BoolEvent))] public class BoolEventEditor : GameEventEditor { } [CustomEditor(typeof(Collider2DEvent))] public class Collider2DEventEditor : GameEventEditor { } [CustomEditor(typeof(ColorEvent))] public class ColorEventEditor : GameEventEditor { } [CustomEditor(typeof(FloatEvent))] public class FloatEventEditor : GameEventEditor { } [CustomEditor(typeof(GameObjectEvent))] public class GameObjectEventEditor : GameEventEditor { } [CustomEditor(typeof(IntEvent))] public class IntGameEventEditor : GameEventEditor { } [CustomEditor(typeof(Vector2Event))] public class Vector2EventEditor : GameEventEditor { } [CustomEditor(typeof(Vector3Event))] public class Vector3EventEditor : GameEventEditor { } [CustomEditor(typeof(VoidEvent))] public class VoidEventEditor : GameEventEditor { } }