private void InitializeTrees() { // We persist tree view states (most importantly, they contain our selection states), // so only create those if we don't have any yet. if (m_ActionMapsTreeState == null) { m_ActionMapsTreeState = new TreeViewState(); } if (m_ActionsTreeState == null) { m_ActionsTreeState = new TreeViewState(); } // Create tree in middle pane showing actions and bindings. We initially // leave this tree empty and populate it by selecting an action map in the // left pane tree. m_ActionsTree = new InputActionTreeView(m_ActionAssetManager.serializedObject, m_ActionsTreeState) { onSelectionChanged = OnActionTreeSelectionChanged, onSerializedObjectModified = ApplyAndReloadTrees, onBindingAdded = p => InputActionSerializationHelpers.RemoveUnusedBindingGroups(p, m_Toolbar.controlSchemes), drawMinusButton = false, title = ("Actions", "A list of InputActions in the InputActionMap selected in the left pane. Also, for each InputAction, the list " + "of bindings that determine the controls that can trigger the action.\n\nThe name of each action must be unique within its InputActionMap."), }; // Create tree in left pane showing action maps. m_ActionMapsTree = new InputActionTreeView(m_ActionAssetManager.serializedObject, m_ActionMapsTreeState) { onBuildTree = () => InputActionTreeView.BuildWithJustActionMapsFromAsset(m_ActionAssetManager.serializedObject), onSelectionChanged = OnActionMapTreeSelectionChanged, onSerializedObjectModified = ApplyAndReloadTrees, onHandleAddNewAction = m_ActionsTree.AddNewAction, drawMinusButton = false, title = ("Action Maps", "A list of InputActionMaps in the asset. Each map can be enabled and disabled separately at runtime and holds " + "its own collection of InputActions which are listed in the middle pane (along with their InputBindings).") }; m_ActionMapsTree.Reload(); m_ActionMapsTree.ExpandAll(); RebuildActionTree(); LoadPropertiesForSelection(); // Sync current search status in toolbar. OnToolbarSearchChanged(); }
private void InitializeTrees() { // We persist tree view states (most importantly, they contain our selection states), // so only create those if we don't have any yet. if (m_ActionMapsTreeState == null) { m_ActionMapsTreeState = new TreeViewState(); } if (m_ActionsTreeState == null) { m_ActionsTreeState = new TreeViewState(); } // Create tree in middle pane showing actions and bindings. We initially // leave this tree empty and populate it by selecting an action map in the // left pane tree. m_ActionsTree = new InputActionTreeView(m_ActionAssetManager.serializedObject, m_ActionsTreeState) { onSelectionChanged = OnActionTreeSelectionChanged, onSerializedObjectModified = ApplyAndReloadTrees, drawMinusButton = false, title = "Actions", }; // Create tree in left pane showing action maps. m_ActionMapsTree = new InputActionTreeView(m_ActionAssetManager.serializedObject, m_ActionMapsTreeState) { onBuildTree = () => InputActionTreeView.BuildWithJustActionMapsFromAsset(m_ActionAssetManager.serializedObject), onSelectionChanged = OnActionMapTreeSelectionChanged, onSerializedObjectModified = ApplyAndReloadTrees, onHandleAddNewAction = m_ActionsTree.AddNewAction, drawMinusButton = false, title = "Action Maps", }; m_ActionMapsTree.Reload(); m_ActionMapsTree.ExpandAll(); RebuildActionTree(); LoadPropertiesForSelection(); // Sync current search status in toolbar. OnToolbarSearchChanged(); }