public void InitIfNeeded(EditorWindow owner, Rect rect)
        {
            if (m_TreeViewState == null)
            {
                m_TreeViewState = new TreeViewState();
            }
            else
            {
                return;
            }

            m_TreeView = new TreeViewController(owner, m_TreeViewState);

            m_TreeView.deselectOnUnhandledMouseDown = true;

            m_TreeViewDataSource = new AddCurvesPopupHierarchyDataSource(m_TreeView);
            TreeViewGUI gui = new AddCurvesPopupHierarchyGUI(m_TreeView, owner);

            m_TreeView.Init(rect,
                            m_TreeViewDataSource,
                            gui,
                            null
                            );

            m_TreeViewDataSource.UpdateData();
        }
        private TreeViewItem AddAnimatableObjectToHierarchy(EditorCurveBinding[] curveBindings, TreeViewItem parentNode, string path)
        {
            TreeViewItem treeViewItem = new AddCurvesPopupObjectNode(parentNode, path, AddCurvesPopupHierarchyDataSource.GetClassName(curveBindings[0]));

            treeViewItem.icon = AddCurvesPopupHierarchyDataSource.GetIcon(curveBindings[0]);
            List <TreeViewItem>       list  = new List <TreeViewItem>();
            List <EditorCurveBinding> list2 = new List <EditorCurveBinding>();

            for (int i = 0; i < curveBindings.Length; i++)
            {
                EditorCurveBinding item = curveBindings[i];
                list2.Add(item);
                if (i == curveBindings.Length - 1 || AnimationWindowUtility.GetPropertyGroupName(curveBindings[i + 1].propertyName) != AnimationWindowUtility.GetPropertyGroupName(item.propertyName))
                {
                    TreeViewItem treeViewItem2 = this.CreateNode(list2.ToArray(), treeViewItem);
                    if (treeViewItem2 != null)
                    {
                        list.Add(treeViewItem2);
                    }
                    list2.Clear();
                }
            }
            list.Sort();
            TreeViewUtility.SetChildParentReferences(list, treeViewItem);
            return(treeViewItem);
        }
 public void InitIfNeeded(EditorWindow owner, Rect rect)
 {
   if (this.m_TreeViewState != null)
     return;
   this.m_TreeViewState = new TreeViewState();
   this.m_TreeView = new TreeView(owner, this.m_TreeViewState);
   this.m_TreeView.deselectOnUnhandledMouseDown = true;
   this.m_TreeViewDataSource = new AddCurvesPopupHierarchyDataSource(this.m_TreeView, this.state);
   TreeViewGUI treeViewGui = (TreeViewGUI) new AddCurvesPopupHierarchyGUI(this.m_TreeView, this.state, owner);
   this.m_TreeView.Init(rect, (ITreeViewDataSource) this.m_TreeViewDataSource, (ITreeViewGUI) treeViewGui, (ITreeViewDragging) null);
   this.m_TreeViewDataSource.UpdateData();
 }
 public void InitIfNeeded(EditorWindow owner, Rect rect)
 {
     if (this.m_TreeViewState == null)
     {
         this.m_TreeViewState = new TreeViewState();
         this.m_TreeView = new TreeViewController(owner, this.m_TreeViewState);
         this.m_TreeView.deselectOnUnhandledMouseDown = true;
         this.m_TreeViewDataSource = new AddCurvesPopupHierarchyDataSource(this.m_TreeView);
         TreeViewGUI gui = new AddCurvesPopupHierarchyGUI(this.m_TreeView, owner);
         this.m_TreeView.Init(rect, this.m_TreeViewDataSource, gui, null);
         this.m_TreeViewDataSource.UpdateData();
     }
 }
 public void InitIfNeeded(EditorWindow owner, Rect rect)
 {
     if (this.m_TreeViewState == null)
     {
         this.m_TreeViewState = new TreeViewState();
         this.m_TreeView      = new TreeView(owner, this.m_TreeViewState);
         this.m_TreeView.deselectOnUnhandledMouseDown = true;
         this.m_TreeViewDataSource = new AddCurvesPopupHierarchyDataSource(this.m_TreeView, this.state);
         TreeViewGUI gui = new AddCurvesPopupHierarchyGUI(this.m_TreeView, this.state, owner);
         this.m_TreeView.Init(rect, this.m_TreeViewDataSource, gui, null);
         this.m_TreeViewDataSource.UpdateData();
         return;
     }
 }
		public void InitIfNeeded(EditorWindow owner, Rect rect)
		{
			if (this.m_TreeViewState == null)
			{
				this.m_TreeViewState = new TreeViewState();
				this.m_TreeView = new TreeView(owner, this.m_TreeViewState);
				this.m_TreeView.deselectOnUnhandledMouseDown = true;
				this.m_TreeViewDataSource = new AddCurvesPopupHierarchyDataSource(this.m_TreeView, this.state);
				TreeViewGUI gui = new AddCurvesPopupHierarchyGUI(this.m_TreeView, this.state, owner);
				this.m_TreeView.Init(rect, this.m_TreeViewDataSource, gui, new GameObjectsTreeViewDragging(this.m_TreeView));
				this.m_TreeViewDataSource.UpdateData();
				return;
			}
		}
        public void InitIfNeeded(EditorWindow owner, Rect rect)
        {
            if (this.m_TreeViewState != null)
            {
                return;
            }
            this.m_TreeViewState = new TreeViewState();
            this.m_TreeView      = new TreeView(owner, this.m_TreeViewState);
            this.m_TreeView.deselectOnUnhandledMouseDown = true;
            this.m_TreeViewDataSource = new AddCurvesPopupHierarchyDataSource(this.m_TreeView, this.state);
            TreeViewGUI treeViewGui = (TreeViewGUI) new AddCurvesPopupHierarchyGUI(this.m_TreeView, this.state, owner);

            this.m_TreeView.Init(rect, (ITreeViewDataSource)this.m_TreeViewDataSource, (ITreeViewGUI)treeViewGui, (ITreeViewDragging)null);
            this.m_TreeViewDataSource.UpdateData();
        }
Example #8
0
        private TreeViewItem AddAnimatableObjectToHierarchy(GameObject root, EditorCurveBinding[] curveBindings, TreeViewItem parentNode, string path)
        {
            TreeViewItem treeViewItem = (TreeViewItem) new AddCurvesPopupObjectNode(parentNode, path, AddCurvesPopupHierarchyDataSource.GetClassName(root, curveBindings[0]));

            treeViewItem.icon = AssetPreview.GetMiniThumbnail(AnimationUtility.GetAnimatedObject(root, curveBindings[0]));
            List <TreeViewItem>       visibleItems           = new List <TreeViewItem>();
            List <EditorCurveBinding> editorCurveBindingList = new List <EditorCurveBinding>();

            for (int index = 0; index < curveBindings.Length; ++index)
            {
                EditorCurveBinding curveBinding = curveBindings[index];
                editorCurveBindingList.Add(curveBinding);
                if (index == curveBindings.Length - 1 || AnimationWindowUtility.GetPropertyGroupName(curveBindings[index + 1].propertyName) != AnimationWindowUtility.GetPropertyGroupName(curveBinding.propertyName))
                {
                    TreeViewItem node = this.CreateNode(editorCurveBindingList.ToArray(), treeViewItem);
                    if (node != null)
                    {
                        visibleItems.Add(node);
                    }
                    editorCurveBindingList.Clear();
                }
            }
            visibleItems.Sort();
            TreeViewUtility.SetChildParentReferences(visibleItems, treeViewItem);
            return(treeViewItem);
        }