Ejemplo n.º 1
0
        private void ProcesMixOut(Rect mixOutRect)
        {
            if (ValidRange(mixOutRect) && mixOutRect.width > 0)
            {
                var clipStyle = TimelineStyles.timelineClip;
                var texture   = clipStyle.normal.background;
                ClipRenderer.RenderTexture(mixOutRect, texture, TimelineStyles.blendMixOut.normal.background,
                                           Color.black);

                Graphics.DrawLineAA(2.5f, new Vector3(mixOutRect.xMin, mixOutRect.yMax - 1f, 0),
                                    new Vector3(mixOutRect.xMax, mixOutRect.yMin + 1f, 0), Color.white);
            }
        }
Ejemplo n.º 2
0
        static void DrawClipBackground(Rect clipCenterSection, ClipBlends blends, bool selected)
        {
            var clipStyle = selected ? DirectorStyles.Instance.timelineClipSelected : DirectorStyles.Instance.timelineClip;

            var texture   = clipStyle.normal.background;
            var lineColor = DirectorStyles.Instance.customSkin.colorClipBlendLines;

            // Center body
            GUI.Label(clipCenterSection, GUIContent.none, clipStyle);

            // Blend/Mix In
            if (blends.inKind != BlendKind.None)
            {
                var mixInRect = blends.inRect;

                if (blends.inKind == BlendKind.Ease)
                {
                    ClipRenderer.RenderTexture(mixInRect, texture, DirectorStyles.Instance.blendMixIn.normal.background, Color.black);

                    if (!selected)
                    {
                        Graphics.DrawLineAA(2.5f, new Vector3(mixInRect.xMin, mixInRect.yMax - 1f, 0), new Vector3(mixInRect.xMax, mixInRect.yMin + 1f, 0), lineColor);
                    }
                }
                else
                {
                    var blendInColor = selected ? Color.black : DirectorStyles.Instance.customSkin.colorClipBlendYin;
                    ClipRenderer.RenderTexture(mixInRect, texture, DirectorStyles.Instance.blendEaseIn.normal.background, blendInColor);

                    if (!selected)
                    {
                        Graphics.DrawLineAA(2.0f, new Vector3(mixInRect.xMin, mixInRect.yMin + 1f, 0), new Vector3(mixInRect.xMax, mixInRect.yMax - 1f, 0), lineColor);
                    }
                }

                Graphics.DrawLineAA(2.0f, mixInRect.max, new Vector2(mixInRect.xMax, mixInRect.yMin), lineColor);
            }

            // Blend/Mix Out
            if (blends.outKind != BlendKind.None)
            {
                var mixOutRect = blends.outRect;

                if (blends.outKind == BlendKind.Ease)
                {
                    ClipRenderer.RenderTexture(mixOutRect, texture, DirectorStyles.Instance.blendMixOut.normal.background, Color.black);

                    if (!selected)
                    {
                        Graphics.DrawLineAA(2.5f, new Vector3(mixOutRect.xMin, mixOutRect.yMin + 1f, 0), new Vector3(mixOutRect.xMax, mixOutRect.yMax - 1f, 0), lineColor);
                    }
                }
                else
                {
                    var blendOutColor = selected ? Color.black : DirectorStyles.Instance.customSkin.colorClipBlendYang;
                    ClipRenderer.RenderTexture(mixOutRect, texture, DirectorStyles.Instance.blendEaseOut.normal.background, blendOutColor);

                    if (!selected)
                    {
                        Graphics.DrawLineAA(2.0f, new Vector3(mixOutRect.xMin, mixOutRect.yMin + 1f, 0), new Vector3(mixOutRect.xMax, mixOutRect.yMax - 1f, 0), lineColor);
                    }
                }

                Graphics.DrawLineAA(2.0f, mixOutRect.min, new Vector2(mixOutRect.xMin, mixOutRect.yMax), lineColor);
            }
        }