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();
        }
Example #2
0
 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;
 }
Example #3
0
 public ClickAction(string name, HotkeySpecifier specifiers, Predicate <GameObject> predicate, Action <GameObject> action)
     : this(name, specifiers, predicate, false, action)
 {
 }
Example #4
0
 public ClickAction(string name, HotkeySpecifier specifiers, Predicate <GameObject> predicate, bool noPromote, Action <GameObject> action)
     : base(name, specifiers, predicate, noPromote)
 {
     this.action = action;
 }
Example #5
0
 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)
 {
 }