Esempio n. 1
0
        protected void DoNodeGUI(Rect rect, AnimationWindowHierarchyNode node, bool selected, bool focused, int row)
        {
            this.InitStyles();
            if (node is AnimationWindowHierarchyMasterNode)
            {
                return;
            }
            float indent = this.k_BaseIndent + (float)(node.depth + node.indent) * this.k_IndentWidth;

            if (node is AnimationWindowHierarchyAddButtonNode)
            {
                if (Event.current.type == EventType.MouseMove && AnimationWindowHierarchyGUI.s_WasInsideValueRectFrame >= 0)
                {
                    if (AnimationWindowHierarchyGUI.s_WasInsideValueRectFrame >= Time.frameCount - 1)
                    {
                        Event.current.Use();
                    }
                    else
                    {
                        AnimationWindowHierarchyGUI.s_WasInsideValueRectFrame = -1;
                    }
                }
                bool flag = this.state.activeGameObject && AnimationWindowUtility.GameObjectIsAnimatable(this.state.activeGameObject, this.state.activeAnimationClip);
                using (new EditorGUI.DisabledScope(!flag))
                {
                    this.DoAddCurveButton(rect, node, row);
                }
            }
            else
            {
                this.DoRowBackground(rect, row);
                this.DoIconAndName(rect, node, selected, focused, indent);
                this.DoFoldout(node, rect, indent, row);
                bool flag2 = false;
                if (node.curves != null)
                {
                    flag2 = !Array.Exists <AnimationWindowCurve>(node.curves, (AnimationWindowCurve curve) => !curve.animationIsEditable);
                }
                using (new EditorGUI.DisabledScope(!flag2))
                {
                    this.DoValueField(rect, node, row);
                    this.HandleContextMenu(rect, node);
                    this.DoCurveDropdown(rect, node, row);
                }
                this.DoCurveColorIndicator(rect, node);
            }
            EditorGUIUtility.SetIconSize(Vector2.zero);
        }
        protected void DoNodeGUI(Rect rect, AnimationWindowHierarchyNode node, bool selected, bool focused, int row)
        {
            this.InitStyles();
            if (node is AnimationWindowHierarchyMasterNode)
            {
                return;
            }
            float indent = this.k_BaseIndent + (float)(node.depth + node.indent) * this.k_IndentWidth;

            if (node is AnimationWindowHierarchyAddButtonNode)
            {
                if (Event.current.type == EventType.MouseMove && AnimationWindowHierarchyGUI.s_WasInsideValueRectFrame >= 0)
                {
                    if (AnimationWindowHierarchyGUI.s_WasInsideValueRectFrame >= Time.frameCount - 1)
                    {
                        Event.current.Use();
                    }
                    else
                    {
                        AnimationWindowHierarchyGUI.s_WasInsideValueRectFrame = -1;
                    }
                }
                bool flag = this.state.m_ActiveGameObject && AnimationWindowUtility.GameObjectIsAnimatable(this.state.m_ActiveGameObject, this.state.m_ActiveAnimationClip);
                EditorGUI.BeginDisabledGroup(!flag);
                this.DoAddCurveButton(rect);
                EditorGUI.EndDisabledGroup();
            }
            else
            {
                this.DoRowBackground(rect, row);
                this.DoIconAndName(rect, node, selected, focused, indent);
                this.DoFoldout(node, rect, indent);
                EditorGUI.BeginDisabledGroup(this.state.IsReadOnly);
                this.DoValueField(rect, node, row);
                this.HandleContextMenu(rect, node);
                EditorGUI.EndDisabledGroup();
                this.DoCurveDropdown(rect, node);
                this.DoCurveColorIndicator(rect, node);
            }
            EditorGUIUtility.SetIconSize(Vector2.zero);
        }