public override void OnInspectorGUI() { serializedObject.Update(); var target = this.target as ActiveMouseActionDisplay; var handler = target.handler; mis = (HotkeySpecifier)EditorGUILayout.EnumFlagsField(mis); if (GUILayout.Button("Create new")) { target.Add(new ClickAction("New Action", mis, (x) => true, (x) => { })); } if (handler) { var actives = new List <MouseAction>(handler.WhereActive()); foreach (var mit in handler.actions) { using (new EditorGUI.DisabledScope(!actives.Contains(mit))) { EditorGUILayout.LabelField($"{mit.name}: priority {mit.priority}, {mit.specifiers.ToString()}"); } } } serializedObject.ApplyModifiedProperties(); }
public DragAction(string name, HotkeySpecifier specifiers, Predicate <GameObject> predicate, bool noPromote, Action <GameObject, Vector3> start, Action <GameObject, Vector3> drag, Action <GameObject, Vector3> end) : base(name, specifiers, predicate, noPromote) { this.start = start; this.drag = drag; this.end = end; }
public ClickAction(string name, HotkeySpecifier specifiers, Predicate <GameObject> predicate, Action <GameObject> action) : this(name, specifiers, predicate, false, action) { }
public ClickAction(string name, HotkeySpecifier specifiers, Predicate <GameObject> predicate, bool noPromote, Action <GameObject> action) : base(name, specifiers, predicate, noPromote) { this.action = action; }
public DragAction(string name, HotkeySpecifier specifiers, Predicate <GameObject> predicate, Action <GameObject, Vector3> start, Action <GameObject, Vector3> drag, Action <GameObject, Vector3> end) : this(name, specifiers, predicate, false, start, drag, end) { }