public static InputActionTreeView Create(SerializedProperty actionSetProperty, Action applyAction, ref TreeViewState treeViewState, ref MultiColumnHeaderState headerViewState)
        {
            if (treeViewState == null)
            {
                treeViewState = new TreeViewState();
            }

            var newHeaderState = CreateHeaderState();

            if (headerViewState != null)
            {
                MultiColumnHeaderState.OverwriteSerializedFields(headerViewState, newHeaderState);
            }
            headerViewState = newHeaderState;

            var header   = new MultiColumnHeader(headerViewState);
            var treeView = new InputActionTreeView(actionSetProperty, applyAction, treeViewState, header);

            // Expand all action set items.
            foreach (var item in treeView.rootItem.children)
            {
                treeView.SetExpanded(item.id, true);
            }

            return(treeView);
        }
Example #2
0
 private void InitializeActionTreeView()
 {
     m_ActionTreeView = InputActionTreeView.Create(serializedObject.FindProperty("m_ActionSets"), Apply,
                                                   ref m_ActionTreeViewState, ref m_ActionTreeViewHeaderState);
 }