Esempio n. 1
0
        protected override void InitData()
        {
            WindowConfigSource = AssetConfigSource.CreateAssetConfigSource("GMCmdWindowConfig", true, typeof(GMCmdWindowSetting));

            m_GraphViewGroup = new GraphViewGroup(m_LayoutGroupMgr, WindowConfigSource, "treeViewStateConfig", "treeViewDataContainer");
            m_GraphView      = m_GraphViewGroup.graphView;

            m_GraphViewGroup.showMainButton = true;
            m_GraphViewGroup.mainButtonName = "Categories";

            m_DataContainer = m_GraphViewGroup.treeItemContainer;
            m_TreeView      = m_GraphViewGroup.treeView;
            m_TreeView.useExpansionAnimation            = true;
            m_TreeView.contextClickItemCallback         = ContextClickItemCallback;
            m_TreeView.contextClickOutsideItemsCallback = ContextClickOutsideItemsCallback;
            m_TreeView.selectionChangedCallback        += TreeViewSelectionChanged;

            m_LayoutGroupMgr.AddViewGroup(m_GraphViewGroup);

            m_GraphViewGroup.objectTreeViewGroup.needUndo         = false;
            m_GraphViewGroup.objectTreeViewGroup.OnGUIInitAction += () =>
            {
                TreeViewSelectionChanged(m_TreeView.GetSelection());
            };
            m_GraphViewGroup.objectTreeViewGroup.GetTreeViewGUI().RenameEndAction += (item, text) =>
            {
                m_TreeView.data.OnSearchChanged();
            };

            m_GraphViewGroup.searchBar.OnTextChangedAction += OnTextChangedAction;
            m_GraphViewGroup.searchBar.LoadConfig("searchText", WindowConfigSource);
            m_TreeView.state.searchString = m_GraphViewGroup.searchBar.SearchText;
            m_TreeView.dragEndedCallback += DragEnedCallback;
        }
Esempio n. 2
0
        public ObjectTreeViewDataSource(TreeView treeView, TreeItemContainer dataContainer = null, EditorWindowConfigSource configSource = null) : base(treeView)
        {
            showRootItem      = false;
            rootIsCollapsable = false;
            m_DataContainer   = dataContainer;
            if (m_DataContainer == null)
            {
                m_DataContainer = new TreeItemContainer();
            }

            m_ConfigSource = configSource;
        }