using UnityEditor; using UnityEngine; namespace UnityAtoms { public abstract 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 sealed class BoolEventEditor : GameEventEditor { } [CustomEditor(typeof(Collider2DEvent))] public sealed class Collider2DEventEditor : GameEventEditor { } [CustomEditor(typeof(ColorEvent))] public sealed class ColorEventEditor : GameEventEditor { } [CustomEditor(typeof(FloatEvent))] public sealed class FloatEventEditor : GameEventEditor { } [CustomEditor(typeof(GameObjectEvent))] public sealed class GameObjectEventEditor : GameEventEditor { } [CustomEditor(typeof(IntEvent))] public sealed class IntGameEventEditor : GameEventEditor { } [CustomEditor(typeof(Vector2Event))] public sealed class Vector2EventEditor : GameEventEditor { } [CustomEditor(typeof(Vector3Event))] public sealed class Vector3EventEditor : GameEventEditor { } [CustomEditor(typeof(VoidEvent))] public sealed class VoidEventEditor : GameEventEditor { } }