Exemplo n.º 1
0
        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();
        }
Exemplo n.º 2
0
        // 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();
        }