/************************************************************************************************************************/

                /// <summary>
                /// Draws the root `property` GUI and calls
                /// <see cref="Editor.TransitionDrawer.DoPropertyGUI"/> for each of its children.
                /// </summary>
                public override void OnGUI(Rect area, SerializedProperty property, GUIContent label)
                {
                    var originalProperty = property.Copy();

                    base.OnGUI(area, property, label);

                    if (!originalProperty.isExpanded)
                    {
                        return;
                    }

                    using (TransitionContext.Get(this, property))
                    {
                        if (Context.Transition == null)
                        {
                            return;
                        }

                        var states = GatherDetails(originalProperty);

                        var indentLevel = EditorGUI.indentLevel;

                        area.yMin = area.yMax - states.GetHeight();

                        EditorGUI.indentLevel++;
                        area = EditorGUI.IndentedRect(area);

                        EditorGUI.indentLevel = 0;
                        states.DoList(area);

                        EditorGUI.indentLevel = indentLevel;

                        TryCollapseArrays();
                    }
                }
Example #2
0
        /************************************************************************************************************************/

        /// <summary>
        /// Draws the root `property` GUI and calls <see cref="DoPropertyGUI"/> for each of its children.
        /// </summary>
        public override void OnGUI(Rect area, SerializedProperty property, GUIContent label)
        {
            InitialiseMode(property);

            using (TransitionContext.Get(this, property))
            {
                var isPreviewing = TransitionPreviewWindow.IsPreviewingCurrentProperty();
                if (isPreviewing)
                {
                    EditorGUI.DrawRect(area, new Color(0.35f, 0.5f, 1, 0.2f));
                }

                float headerHeight;
                DoHeaderGUI(area, property, label, isPreviewing, out headerHeight);
                DoChildPropertiesGUI(area, headerHeight, property);
            }
        }
Example #3
0
        /************************************************************************************************************************/

        /// <summary>
        /// Draws the root `property` GUI and calls <see cref="DoPropertyGUI"/> for each of its children.
        /// </summary>
        public override void OnGUI(Rect area, SerializedProperty property, GUIContent label)
        {
            InitialiseMode(property);

            using (TransitionContext.Get(this, property))
            {
                // Highlight the area if this transition is currently being previewed.
                var isPreviewing = TransitionPreviewWindow.IsPreviewingCurrentProperty();
                if (isPreviewing)
                {
                    var highlightArea = area;
                    highlightArea.xMin -= AnimancerGUI.IndentSize;
                    EditorGUI.DrawRect(highlightArea, new Color(0.35f, 0.5f, 1, 0.2f));
                }

                float headerHeight;
                DoHeaderGUI(area, property, label, isPreviewing, out headerHeight);
                DoChildPropertiesGUI(area, headerHeight, property);
            }
        }