Пример #1
0
        /// <summary>
        ///     Gets the curves bounding rect.
        /// </summary>
        /// <returns>The curves bounding rect.</returns>
        private Rect GetCurvesBoundingRect()
        {
            Rect xBounds = NormalCurveRendererWrapper.GetBounds(m_CurveXProperty.animationCurveValue);
            Rect yBounds = NormalCurveRendererWrapper.GetBounds(m_CurveYProperty.animationCurveValue);
            Rect zBounds = NormalCurveRendererWrapper.GetBounds(m_CurveZProperty.animationCurveValue);

            Rect output = new Rect(xBounds);

            output = output.Encapsulate(yBounds);
            return(output.Encapsulate(zBounds));
        }
Пример #2
0
        /// <summary>
        ///     Shows the curve editor window for the given curve.
        /// </summary>
        /// <param name="curve">Curve.</param>
        /// <param name="title">Title.</param>
        /// <param name="color">Color.</param>
        private void EditCurve(AnimationCurve curve, string title, Color color)
        {
            CurveEditorWindowWrapper.ShowCurveEditorWindow(title);
            CurveEditorWindowWrapper.curve = curve;
            CurveEditorWindowWrapper.color = color;

            Rect bounds = NormalCurveRendererWrapper.GetBounds(curve);

            if (HydraMathUtils.Approximately(bounds.height, 0.0f))
            {
                bounds.height = bounds.width;
                bounds.y     -= bounds.height / 2.0f;
            }

            CurveEditorWindowWrapper.Frame(bounds);
        }