/// <summary>
 /// Compares this object with another <c>ClipDrawOptions</c>.
 /// </summary>
 /// <param name="other">The object to compare with.</param>
 /// <returns>Returns true if <c>this</c> and <paramref name="other"/> are equal.</returns>
 public bool Equals(ClipDrawOptions other)
 {
     return(errorText == other.errorText &&
            tooltip == other.tooltip &&
            highlightColor == other.highlightColor &&
            System.Linq.Enumerable.SequenceEqual(icons, other.icons));
 }
        public static void DrawSimpleClip(TimelineClip clip, Rect targetRect, ClipBorder border, Color overlay, ClipDrawOptions drawOptions)
        {
            GUI.BeginClip(targetRect);
            var clipRect = new Rect(0.0f, 0.0f, targetRect.width, targetRect.height);

            var orgColor = GUI.color;

            GUI.color = overlay;

            DrawClipBackground(clipRect, false);
            GUI.color = orgColor;

            if (clipRect.width <= k_MinClipWidth)
            {
                clipRect.width = k_MinClipWidth;
            }

            DrawClipSwatch(targetRect, drawOptions.highlightColor * overlay);

            if (targetRect.width >= k_ClipInOutMinWidth)
            {
                DrawClipInOut(clipRect, clip);
            }

            var textRect = clipRect;

            textRect.xMin += k_ClipLabelPadding;
            textRect.xMax -= k_ClipLabelPadding;

            if (textRect.width > k_ClipLabelMinWidth)
            {
                DrawClipLabel(clip.displayName, textRect, Color.white, drawOptions.errorText, drawOptions.displayClipName);
            }

            DrawClipSelectionBorder(clipRect, border, ClipBlends.kNone);

            GUI.EndClip();
        }
Esempio n. 3
0
        public static void DrawSimpleClip(TimelineClip clip, Rect targetRect, ClipBorder border, Color overlay, ClipDrawOptions drawOptions, ClipBlends blends)
        {
            GUI.BeginClip(targetRect);

            var clipRect = new Rect(0.0f, 0.0f, targetRect.width, targetRect.height);

            var orgColor = GUI.color;

            GUI.color = overlay;

            DrawClipBackground(clipRect, ClipBlends.kNone, false);
            GUI.color = orgColor;

            if (clipRect.width <= k_MinClipWidth)
            {
                clipRect.width = k_MinClipWidth;
            }

            DrawClipEdges(clipRect, drawOptions.highlightColor * overlay, s_InlineLightColor * overlay, s_InlineShadowColor * overlay,
                          blends.inKind != BlendKind.Mix, blends.outKind != BlendKind.Mix);

            DrawClipTimescale(clipRect, clip.timeScale);

            if (targetRect.width >= k_ClipInOutMinWidth)
            {
                DrawClipInOut(clipRect, clip);
            }

            var textRect = clipRect;

            textRect.xMin += k_ClipLabelPadding;
            textRect.xMax -= k_ClipLabelPadding;

            if (textRect.width > k_ClipLabelMinWidth)
            {
                DrawClipLabel(clip.displayName, textRect, Color.white, drawOptions.errorText);
            }

            if (border != null)
            {
                DrawBorder(clipRect, border, ClipBlends.kNone);
            }

            GUI.EndClip();
        }