Exemple #1
0
        public TimelineTreeViewGUI(TimelineWindow sequencerWindow, TimelineAsset timeline, Rect rect)
        {
            m_Timeline = timeline;
            m_Window   = sequencerWindow;

            var treeviewState = new TreeViewState();

            treeviewState.scrollPos = new Vector2(treeviewState.scrollPos.x, TimelineWindowViewPrefs.GetOrCreateViewModel(m_Timeline).verticalScroll);

            m_TreeView = new TreeViewController(sequencerWindow, treeviewState);
            m_TreeView.horizontalScrollbarStyle = GUIStyle.none;
            m_TreeView.scrollViewStyle          = GUI.skin.scrollView;
            m_TreeView.keyboardInputCallback    = sequencerWindow.TreeViewKeyboardCallback;


            m_TimelineTreeView = new TimelineTreeView(sequencerWindow, m_TreeView);
            var dragging = new TimelineDragging(m_TreeView, m_Window, m_Timeline);

            m_DataSource = new TimelineDataSource(this, m_TreeView, sequencerWindow);

            m_DataSource.onVisibleRowsChanged += m_TimelineTreeView.CalculateRowRects;
            m_TreeView.Init(rect, m_DataSource, m_TimelineTreeView, dragging);

            m_DataSource.ExpandItems(m_DataSource.root);
        }