void DeleteSelectedRows(SerializedProperty actionProperty)
        {
            var row     = m_TreeView.GetSelectedRow();
            var rowType = row.GetType();

            // Remove composite bindings
            if (rowType == typeof(CompositeTreeItem))
            {
                for (var i = row.children.Count - 1; i >= 0; i--)
                {
                    var composite = (CompositeTreeItem)row.children[i];

                    InputActionSerializationHelpers.RemoveBinding(actionProperty, composite.index);
                }
                InputActionSerializationHelpers.RemoveBinding(actionProperty, row.index);
            }

            // Remove bindings
            if (rowType == typeof(BindingTreeItem))
            {
                InputActionSerializationHelpers.RemoveBinding(actionProperty, row.index);
            }

            m_TreeView.SetSelection(new List <int>());
            m_TreeView.Reload();
        }
 void OnUndoRedoCallback()
 {
     if (m_TreeView == null)
     {
         return;
     }
     m_TreeView.Reload();
     OnSelectionChanged();
     SaveChangesToAsset();
 }
 void OnUndoCallback()
 {
     if (m_TreeView == null)
     {
         return;
     }
     m_IsAssetDirty = true;
     m_TreeView.Reload();
     OnSelectionChanged();
 }
Example #4
0
 void OnUndoCallback()
 {
     if (m_TreeView == null)
     {
         return;
     }
     m_TreeView.Reload();
     m_TreeView.Repaint();
     OnSelectionChanged();
 }
        public static InputActionListTreeView CreateFromSerializedObject(Action applyAction, SerializedObject serializedObject, ref TreeViewState treeViewState)
        {
            if (treeViewState == null)
                treeViewState = new TreeViewState();

            var treeView = new InputActionListTreeView(applyAction, treeViewState);
            treeView.m_SerializedObject = serializedObject;
            treeView.Reload();
            treeView.ExpandAll();
            return treeView;
        }
Example #6
0
 public CopyPasteUtility(InputActionListTreeView treeView)
 {
     m_TreeView = treeView;
     m_Apply    = () => { m_TreeView.Reload(); };
 }