コード例 #1
0
        static void DrawTrackStateBox(Rect trackRect, TrackAsset track)
        {
            var styles = DirectorStyles.Instance;

            bool locked           = track.locked && !TimelineUtility.IsLockedFromGroup(track);
            bool muted            = track.muted && !TimelineUtility.IsParentMuted(track);
            bool allSubTrackMuted = TimelineUtility.IsAllSubTrackMuted(track);

            GUIContent content = null;

            if (locked && muted)
            {
                content = Styles.s_LockedAndMuted;
                if (!allSubTrackMuted)
                {
                    content = Styles.s_LockedAndPartiallyMuted;
                }
            }
            else if (locked)
            {
                content = Styles.s_Locked;
            }
            else if (muted)
            {
                content = Styles.s_Muted;
                if (!allSubTrackMuted)
                {
                    content = Styles.s_PartiallyMuted;
                }
            }

            // the track could be locked, but we only show the 'locked portion' on the upper most track
            //  that is causing the lock
            if (content == null)
            {
                return;
            }

            Rect textRect = Graphics.CalculateTextBoxSize(trackRect, styles.fontClip, content, WindowConstants.overlayTextPadding);

            TimelineWindow.instance.OverlayDrawData.Add(
                OverlayDrawer.CreateTextBoxOverlay(
                    GUIClip.Unclip(textRect),
                    content.text, styles.fontClip,
                    Color.white,
                    styles.customSkin.colorLockTextBG,
                    styles.displayBackground));
        }
コード例 #2
0
        static void DrawMuteOverlay(DrawData data)
        {
            DirectorStyles styles = TimelineWindow.styles;

            var colorOverlay = OverlayDrawer.CreateColorOverlay(GUIClip.Unclip(data.contentRect), styles.customSkin.colorTrackDarken);

            colorOverlay.Draw();

            Rect textRect   = Graphics.CalculateTextBoxSize(data.contentRect, styles.fontClip, k_Muted, WindowConstants.overlayTextPadding);
            var  boxOverlay = OverlayDrawer.CreateTextBoxOverlay(
                GUIClip.Unclip(textRect),
                k_Muted.text,
                styles.fontClip,
                Color.white,
                styles.customSkin.colorLockTextBG,
                styles.displayBackground);

            boxOverlay.Draw();
        }