private void OnEnable()
        {
            minSize = new Vector2(600, 300);

            if (m_AddActionIconGUI == null)
            {
                m_AddActionIconGUI = EditorGUIUtility.TrIconContent("Toolbar Plus", "Add Action");
            }
            if (m_AddActionMapIconGUI == null)
            {
                m_AddActionMapIconGUI = EditorGUIUtility.TrIconContent("Toolbar Plus", "Add Action Map");
            }
            if (m_AddBindingGUI == null)
            {
                m_AddBindingGUI = EditorGUIUtility.TrIconContent("Toolbar Plus More", "Add Binding");
            }

            Undo.undoRedoPerformed += OnUndoRedoCallback;
            if (m_ActionAssetManager == null)
            {
                return;
            }

            // Initialize after assembly reload
            m_ActionAssetManager.InitializeObjectReferences();
            m_ActionAssetManager.SetReferences(SetTitle);
            m_InputActionWindowToolbar.SetReferences(m_ActionAssetManager, Apply);
            m_InputActionWindowToolbar.RebuildData();
            m_ContextMenu.SetReferences(this, m_ActionAssetManager);

            InitializeTrees();
            OnActionMapSelection();
            LoadPropertiesForSelection();
        }
        // Set asset would usually only be called when the window is open
        private void SetAsset(InputActionAsset referencedObject)
        {
            m_ActionAssetManager = new InputActionAssetManager(referencedObject);
            m_ActionAssetManager.SetReferences(SetTitle);
            m_ActionAssetManager.InitializeObjectReferences();
            m_InputActionWindowToolbar = new InputActionWindowToolbar(m_ActionAssetManager, Apply);
            m_ContextMenu = new ActionInspectorContextMenu(this, m_ActionAssetManager);
            InitializeTrees();

            // Make sure first actions map selected and actions tree expanded
            m_ActionMapsTree.SelectFirstRow();
            OnActionMapSelection();
            m_ActionsTree.ExpandAll();
            LoadPropertiesForSelection();
        }
Exemple #3
0
        // Set asset would usually only be called when the window is open
        private void SetAsset(InputActionAsset asset)
        {
            m_ActionAssetManager = new InputActionAssetManager(asset)
            {
                onDirtyChanged = OnDirtyChanged
            };
            m_ActionAssetManager.InitializeObjectReferences();

            InitializeTrees();
            LoadControlSchemes();

            // Select first action map in asset.
            m_ActionMapsTree.SelectFirstToplevelItem();

            UpdateWindowTitle();
        }
        // Set asset would usually only be called when the window is open
        private void SetAsset(InputActionAsset asset)
        {
            m_ActionAssetManager = new InputActionAssetManager(asset)
            {
                onDirtyChanged = OnDirtyChanged
            };
            m_ActionAssetManager.InitializeObjectReferences();
            m_InputActionWindowToolbar = new InputActionWindowToolbar(m_ActionAssetManager, ApplyAndReload);
            m_ContextMenu = new ActionInspectorContextMenu(this, m_ActionAssetManager, m_InputActionWindowToolbar);
            InitializeTrees();

            // Make sure first actions map selected and actions tree expanded
            m_ActionMapsTree.SelectFirstRow();
            OnActionMapSelection();
            m_ActionsTree.ExpandAll();
            LoadPropertiesForSelection();

            UpdateWindowTitle();
        }