Inheritance: UnityEditorInternal.AnimationWindowHierarchyNode
 private AnimationWindowHierarchyPropertyNode AddPropertyToHierarchy(AnimationWindowCurve curve, AnimationWindowHierarchyNode parentNode)
 {
     AnimationWindowHierarchyPropertyNode node = new AnimationWindowHierarchyPropertyNode(curve.type, curve.propertyName, curve.path, parentNode, curve.binding, curve.isPPtrCurve);
     if (parentNode.icon != null)
     {
         node.icon = parentNode.icon;
     }
     else
     {
         node.icon = this.GetIcon(curve.binding);
     }
     node.indent = curve.depth;
     node.curves = new AnimationWindowCurve[] { curve };
     return node;
 }
Esempio n. 2
0
 private void DoFoldout(AnimationWindowHierarchyNode node, Rect rect, float indent)
 {
     if (this.m_TreeView.data.IsExpandable((TreeViewItem)node))
     {
         Rect position = rect;
         position.x     = indent;
         position.width = this.k_FoldoutWidth;
         EditorGUI.BeginChangeCheck();
         bool expand = GUI.Toggle(position, this.m_TreeView.data.IsExpanded((TreeViewItem)node), GUIContent.none, TreeViewGUI.s_Styles.foldout);
         if (!EditorGUI.EndChangeCheck())
         {
             return;
         }
         if (Event.current.alt)
         {
             this.m_TreeView.data.SetExpandedWithChildren((TreeViewItem)node, expand);
         }
         else
         {
             this.m_TreeView.data.SetExpanded((TreeViewItem)node, expand);
         }
         if (!expand)
         {
             return;
         }
         this.m_TreeView.UserExpandedNode((TreeViewItem)node);
     }
     else
     {
         AnimationWindowHierarchyPropertyNode hierarchyPropertyNode = node as AnimationWindowHierarchyPropertyNode;
         AnimationWindowHierarchyState        state = this.m_TreeView.state as AnimationWindowHierarchyState;
         if (hierarchyPropertyNode == null || !hierarchyPropertyNode.isPptrNode)
         {
             return;
         }
         Rect position = rect;
         position.x     = indent;
         position.width = this.k_FoldoutWidth;
         EditorGUI.BeginChangeCheck();
         bool tallMode1 = state.GetTallMode((AnimationWindowHierarchyNode)hierarchyPropertyNode);
         bool tallMode2 = GUI.Toggle(position, tallMode1, GUIContent.none, TreeViewGUI.s_Styles.foldout);
         if (!EditorGUI.EndChangeCheck())
         {
             return;
         }
         state.SetTallMode((AnimationWindowHierarchyNode)hierarchyPropertyNode, tallMode2);
     }
 }
Esempio n. 3
0
        private AnimationWindowHierarchyPropertyNode AddPropertyToHierarchy(AnimationWindowCurve curve, AnimationWindowHierarchyNode parentNode)
        {
            AnimationWindowHierarchyPropertyNode node = new AnimationWindowHierarchyPropertyNode(curve.type, curve.propertyName, curve.path, parentNode, curve.binding, curve.isPPtrCurve);

            if (parentNode.icon != null)
            {
                node.icon = parentNode.icon;
            }
            else
            {
                node.icon = this.GetIcon(curve.binding);
            }
            node.indent = curve.depth;
            node.curves = new AnimationWindowCurve[] { curve };
            return(node);
        }
        private AnimationWindowHierarchyPropertyGroupNode AddPropertyGroupToHierarchy(AnimationWindowCurve[] curves, AnimationWindowHierarchyNode parentNode)
        {
            List <AnimationWindowHierarchyNode>       windowHierarchyNodeList = new List <AnimationWindowHierarchyNode>();
            AnimationWindowHierarchyPropertyGroupNode propertyGroupNode       = new AnimationWindowHierarchyPropertyGroupNode(curves[0].type, AnimationWindowUtility.GetPropertyGroupName(curves[0].propertyName), curves[0].path, (TreeViewItem)parentNode);

            propertyGroupNode.icon   = this.GetIcon(curves[0].binding);
            propertyGroupNode.indent = curves[0].depth;
            propertyGroupNode.curves = curves;
            foreach (AnimationWindowCurve curve in curves)
            {
                AnimationWindowHierarchyPropertyNode hierarchy = this.AddPropertyToHierarchy(curve, (AnimationWindowHierarchyNode)propertyGroupNode);
                hierarchy.displayName = AnimationWindowUtility.GetPropertyDisplayName(hierarchy.propertyName);
                windowHierarchyNodeList.Add((AnimationWindowHierarchyNode)hierarchy);
            }
            TreeViewUtility.SetChildParentReferences(new List <TreeViewItem>((IEnumerable <TreeViewItem>)windowHierarchyNodeList.ToArray()), (TreeViewItem)propertyGroupNode);
            return(propertyGroupNode);
        }
        private AnimationWindowHierarchyPropertyNode AddPropertyToHierarchy(AnimationWindowCurve curve, AnimationWindowHierarchyNode parentNode, SerializedObject so)
        {
            AnimationWindowHierarchyPropertyNode node = new AnimationWindowHierarchyPropertyNode(curve.type, 0, curve.propertyName, curve.path, parentNode, curve.binding, curve.isPPtrCurve, AnimationWindowUtility.GetNicePropertyDisplayName(curve.binding, so));

            if (parentNode.icon != null)
            {
                node.icon = parentNode.icon;
            }
            else
            {
                node.icon = GetIcon(curve.binding);
            }

            node.indent = curve.depth;
            node.curves = new[] { curve };
            return(node);
        }
Esempio n. 6
0
 private void DoFoldout(AnimationWindowHierarchyNode node, Rect rect, float indent, int row)
 {
     if (this.m_TreeView.data.IsExpandable(node))
     {
         Rect position = rect;
         position.x     = indent;
         position.width = this.k_FoldoutWidth;
         EditorGUI.BeginChangeCheck();
         bool flag = GUI.Toggle(position, this.m_HierarchyItemFoldControlIDs[row], this.m_TreeView.data.IsExpanded(node), GUIContent.none, TreeViewGUI.s_Styles.foldout);
         if (EditorGUI.EndChangeCheck())
         {
             if (Event.current.alt)
             {
                 this.m_TreeView.data.SetExpandedWithChildren(node, flag);
             }
             else
             {
                 this.m_TreeView.data.SetExpanded(node, flag);
             }
             if (flag)
             {
                 this.m_TreeView.UserExpandedItem(node);
             }
         }
     }
     else
     {
         AnimationWindowHierarchyPropertyNode animationWindowHierarchyPropertyNode = node as AnimationWindowHierarchyPropertyNode;
         AnimationWindowHierarchyState        animationWindowHierarchyState        = this.m_TreeView.state as AnimationWindowHierarchyState;
         if (animationWindowHierarchyPropertyNode != null && animationWindowHierarchyPropertyNode.isPptrNode)
         {
             Rect position2 = rect;
             position2.x     = indent;
             position2.width = this.k_FoldoutWidth;
             EditorGUI.BeginChangeCheck();
             bool flag2 = animationWindowHierarchyState.GetTallMode(animationWindowHierarchyPropertyNode);
             flag2 = GUI.Toggle(position2, this.m_HierarchyItemFoldControlIDs[row], flag2, GUIContent.none, TreeViewGUI.s_Styles.foldout);
             if (EditorGUI.EndChangeCheck())
             {
                 animationWindowHierarchyState.SetTallMode(animationWindowHierarchyPropertyNode, flag2);
             }
         }
     }
 }
 private void DoFoldout(AnimationWindowHierarchyNode node, Rect rect, float indent)
 {
     if (base.m_TreeView.data.IsExpandable(node))
     {
         Rect position = rect;
         position.x     = indent;
         position.width = base.k_FoldoutWidth;
         EditorGUI.BeginChangeCheck();
         bool expand = GUI.Toggle(position, base.m_TreeView.data.IsExpanded(node), GUIContent.none, TreeViewGUI.s_Styles.foldout);
         if (EditorGUI.EndChangeCheck())
         {
             if (Event.current.alt)
             {
                 base.m_TreeView.data.SetExpandedWithChildren(node, expand);
             }
             else
             {
                 base.m_TreeView.data.SetExpanded(node, expand);
             }
             if (expand)
             {
                 base.m_TreeView.UserExpandedNode(node);
             }
         }
     }
     else
     {
         AnimationWindowHierarchyPropertyNode node2 = node as AnimationWindowHierarchyPropertyNode;
         AnimationWindowHierarchyState        state = base.m_TreeView.state as AnimationWindowHierarchyState;
         if ((node2 != null) && node2.isPptrNode)
         {
             Rect rect3 = rect;
             rect3.x     = indent;
             rect3.width = base.k_FoldoutWidth;
             EditorGUI.BeginChangeCheck();
             bool tallMode = state.GetTallMode(node2);
             tallMode = GUI.Toggle(rect3, tallMode, GUIContent.none, TreeViewGUI.s_Styles.foldout);
             if (EditorGUI.EndChangeCheck())
             {
                 state.SetTallMode(node2, tallMode);
             }
         }
     }
 }
Esempio n. 8
0
        private AnimationWindowHierarchyPropertyGroupNode AddPropertyGroupToHierarchy(AnimationWindowCurve[] curves, AnimationWindowHierarchyNode parentNode)
        {
            List <AnimationWindowHierarchyNode> list = new List <AnimationWindowHierarchyNode>();
            Type type = curves[0].type;
            AnimationWindowHierarchyPropertyGroupNode animationWindowHierarchyPropertyGroupNode = new AnimationWindowHierarchyPropertyGroupNode(type, AnimationWindowUtility.GetPropertyGroupName(curves[0].propertyName), curves[0].path, parentNode);

            animationWindowHierarchyPropertyGroupNode.icon   = this.GetIcon(curves[0].binding);
            animationWindowHierarchyPropertyGroupNode.indent = curves[0].depth;
            animationWindowHierarchyPropertyGroupNode.curves = curves;
            for (int i = 0; i < curves.Length; i++)
            {
                AnimationWindowCurve curve = curves[i];
                AnimationWindowHierarchyPropertyNode animationWindowHierarchyPropertyNode = this.AddPropertyToHierarchy(curve, animationWindowHierarchyPropertyGroupNode);
                animationWindowHierarchyPropertyNode.displayName = AnimationWindowUtility.GetPropertyDisplayName(animationWindowHierarchyPropertyNode.propertyName);
                list.Add(animationWindowHierarchyPropertyNode);
            }
            TreeViewUtility.SetChildParentReferences(new List <TreeViewItem>(list.ToArray()), animationWindowHierarchyPropertyGroupNode);
            return(animationWindowHierarchyPropertyGroupNode);
        }
Esempio n. 9
0
        private AnimationWindowHierarchyPropertyGroupNode AddPropertyGroupToHierarchy(AnimationWindowCurve[] curves, AnimationWindowHierarchyNode parentNode)
        {
            List <AnimationWindowHierarchyNode>       list = new List <AnimationWindowHierarchyNode>();
            AnimationWindowHierarchyPropertyGroupNode node = new AnimationWindowHierarchyPropertyGroupNode(curves[0].type, AnimationWindowUtility.GetPropertyGroupName(curves[0].propertyName), curves[0].path, parentNode)
            {
                icon   = this.GetIcon(curves[0].binding),
                indent = curves[0].depth,
                curves = curves
            };

            foreach (AnimationWindowCurve curve in curves)
            {
                AnimationWindowHierarchyPropertyNode item = this.AddPropertyToHierarchy(curve, node);
                item.displayName = AnimationWindowUtility.GetPropertyDisplayName(item.propertyName);
                list.Add(item);
            }
            TreeViewUtility.SetChildParentReferences(new List <TreeViewItem>(list.ToArray()), node);
            return(node);
        }
        private AnimationWindowHierarchyPropertyNode AddPropertyToHierarchy(AnimationWindowCurve curve, AnimationWindowHierarchyNode parentNode)
        {
            AnimationWindowHierarchyPropertyNode hierarchyPropertyNode = new AnimationWindowHierarchyPropertyNode(curve.type, curve.propertyName, curve.path, (TreeViewItem)parentNode, curve.binding, curve.isPPtrCurve);

            if ((UnityEngine.Object)parentNode.icon != (UnityEngine.Object)null)
            {
                hierarchyPropertyNode.icon = parentNode.icon;
            }
            else
            {
                hierarchyPropertyNode.icon = this.GetIcon(curve.binding);
            }
            hierarchyPropertyNode.indent = curve.depth;
            hierarchyPropertyNode.curves = new AnimationWindowCurve[1]
            {
                curve
            };
            return(hierarchyPropertyNode);
        }
        private AnimationWindowHierarchyPropertyNode AddPropertyToHierarchy(AnimationWindowSelectionItem selectedItem, AnimationWindowCurve curve, AnimationWindowHierarchyNode parentNode)
        {
            AnimationWindowHierarchyPropertyNode animationWindowHierarchyPropertyNode = new AnimationWindowHierarchyPropertyNode(curve.type, selectedItem.id, curve.propertyName, curve.path, parentNode, curve.binding, curve.isPPtrCurve);

            if (parentNode.icon != null)
            {
                animationWindowHierarchyPropertyNode.icon = parentNode.icon;
            }
            else
            {
                animationWindowHierarchyPropertyNode.icon = this.GetIcon(curve.binding);
            }
            animationWindowHierarchyPropertyNode.indent = curve.depth;
            animationWindowHierarchyPropertyNode.curves = new AnimationWindowCurve[]
            {
                curve
            };
            return(animationWindowHierarchyPropertyNode);
        }
        // Draw foldout (after text content above to ensure drop down icon is rendered above selection highlight)
        private void DoFoldout(AnimationWindowHierarchyNode node, Rect rect, float indent, int row)
        {
            if (m_TreeView.data.IsExpandable(node))
            {
                Rect toggleRect = rect;
                toggleRect.x     = indent;
                toggleRect.width = foldoutStyleWidth;
                EditorGUI.BeginChangeCheck();
                bool newExpandedValue = GUI.Toggle(toggleRect, m_HierarchyItemFoldControlIDs[row], m_TreeView.data.IsExpanded(node), GUIContent.none, foldoutStyle);
                if (EditorGUI.EndChangeCheck())
                {
                    if (Event.current.alt)
                    {
                        m_TreeView.data.SetExpandedWithChildren(node, newExpandedValue);
                    }
                    else
                    {
                        m_TreeView.data.SetExpanded(node, newExpandedValue);
                    }
                }
            }
            else
            {
                AnimationWindowHierarchyPropertyNode hierarchyPropertyNode = node as AnimationWindowHierarchyPropertyNode;
                AnimationWindowHierarchyState        hierarchyState        = m_TreeView.state as AnimationWindowHierarchyState;

                if (hierarchyPropertyNode != null && hierarchyPropertyNode.isPptrNode)
                {
                    Rect toggleRect = rect;
                    toggleRect.x     = indent;
                    toggleRect.width = foldoutStyleWidth;

                    EditorGUI.BeginChangeCheck();
                    bool tallMode = hierarchyState.GetTallMode(hierarchyPropertyNode);
                    tallMode = GUI.Toggle(toggleRect, m_HierarchyItemFoldControlIDs[row], tallMode, GUIContent.none, foldoutStyle);
                    if (EditorGUI.EndChangeCheck())
                    {
                        hierarchyState.SetTallMode(hierarchyPropertyNode, tallMode);
                    }
                }
            }
        }
        private AnimationWindowHierarchyPropertyGroupNode AddPropertyGroupToHierarchy(AnimationWindowCurve[] curves, AnimationWindowHierarchyNode parentNode)
        {
            List <AnimationWindowHierarchyNode> childNodes = new List <AnimationWindowHierarchyNode>();

            System.Type animatableObjectType = curves[0].type;
            AnimationWindowHierarchyPropertyGroupNode node = new AnimationWindowHierarchyPropertyGroupNode(animatableObjectType, 0, AnimationWindowUtility.GetPropertyGroupName(curves[0].propertyName), curves[0].path, parentNode);

            node.icon = GetIcon(curves[0].binding);

            node.indent = curves[0].depth;
            node.curves = curves;

            foreach (AnimationWindowCurve curve in curves)
            {
                AnimationWindowHierarchyPropertyNode childNode = AddPropertyToHierarchy(curve, node);
                // For child nodes we do not want to display the type in front (It is already shown by the group node)
                childNode.displayName = AnimationWindowUtility.GetPropertyDisplayName(childNode.propertyName);
                childNodes.Add(childNode);
            }

            TreeViewUtility.SetChildParentReferences(new List <TreeViewItem>(childNodes.ToArray()), node);
            return(node);
        }
Esempio n. 14
0
        public override void BeginRowGUI()
        {
            base.BeginRowGUI();
            this.HandleDelete();
            int rowCount = this.m_TreeView.data.rowCount;

            this.m_HierarchyItemFoldControlIDs   = new int[rowCount];
            this.m_HierarchyItemValueControlIDs  = new int[rowCount];
            this.m_HierarchyItemButtonControlIDs = new int[rowCount];
            for (int i = 0; i < rowCount; i++)
            {
                AnimationWindowHierarchyPropertyNode animationWindowHierarchyPropertyNode = this.m_TreeView.data.GetItem(i) as AnimationWindowHierarchyPropertyNode;
                if (animationWindowHierarchyPropertyNode != null && !animationWindowHierarchyPropertyNode.isPptrNode)
                {
                    this.m_HierarchyItemValueControlIDs[i] = GUIUtility.GetControlID(FocusType.Keyboard);
                }
                else
                {
                    this.m_HierarchyItemValueControlIDs[i] = 0;
                }
                this.m_HierarchyItemFoldControlIDs[i]   = GUIUtility.GetControlID(FocusType.Passive);
                this.m_HierarchyItemButtonControlIDs[i] = GUIUtility.GetControlID(FocusType.Passive);
            }
        }
 private AnimationWindowHierarchyPropertyNode AddPropertyToHierarchy(AnimationWindowCurve curve, AnimationWindowHierarchyNode parentNode)
 {
   AnimationWindowHierarchyPropertyNode hierarchyPropertyNode = new AnimationWindowHierarchyPropertyNode(curve.type, curve.propertyName, curve.path, (TreeViewItem) parentNode, curve.binding, curve.isPPtrCurve);
   if ((UnityEngine.Object) parentNode.icon != (UnityEngine.Object) null)
     hierarchyPropertyNode.icon = parentNode.icon;
   else
     hierarchyPropertyNode.icon = this.GetIcon(curve.binding);
   hierarchyPropertyNode.indent = curve.depth;
   hierarchyPropertyNode.curves = new AnimationWindowCurve[1]
   {
     curve
   };
   return hierarchyPropertyNode;
 }