public void InitIfNeeded(Rect rect, CurveDataSource dataSource, bool isNewSelection) { if (Event.current.type != EventType.Layout) { return; } m_CurveDataSource = dataSource; var clip = dataSource.animationClip; List <EditorCurveBinding> allBindings = new List <EditorCurveBinding>(); allBindings.Add(new EditorCurveBinding { propertyName = "Summary" }); if (clip != null) { allBindings.AddRange(AnimationUtility.GetCurveBindings(clip)); } m_DopeLines.list = allBindings.ToArray(); if (m_TreeViewState != null) { if (isNewSelection) { RefreshAll(); } return; } m_TreeViewState = m_TrackGlobalTreeViewState != null ? m_TrackGlobalTreeViewState : new TreeViewState(); m_TreeView = new TreeViewController(m_Window, m_TreeViewState) { useExpansionAnimation = false, deselectOnUnhandledMouseDown = true }; m_TreeView.selectionChangedCallback += OnItemSelectionChanged; m_TreeViewDataSource = new BindingTreeViewDataSource(m_TreeView, clip, m_CurveDataSource); m_TreeViewGUI = new BindingTreeViewGUI(m_TreeView); m_TreeView.Init(rect, m_TreeViewDataSource, m_TreeViewGUI, null); m_TreeViewDataSource.UpdateData(); RefreshSelection(); }