protected static void DrawTrackStateBox(Rect trackRect, TrackAsset track) { const float k_LockTextPadding = 40f; var styles = DirectorStyles.Instance; bool locked = track.locked && !track.parentLocked; 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; } var textRect = trackRect; textRect.width = styles.fontClip.CalcSize(content).x + k_LockTextPadding; textRect.x += (trackRect.width - textRect.width) / 2f; textRect.height -= 4f; textRect.y += 2f; using (new GUIColorOverride(styles.customSkin.colorLockTextBG)) { GUI.Box(textRect, GUIContent.none, styles.displayBackground); } Timeline.Graphics.ShadowLabel(textRect, content, styles.fontClip, Color.white, Color.black); }
void DrawTrackStateBox(Rect trackRect, TrackAsset track) { const float k_LockTextPadding = 40f; 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; } var textRect = trackRect; textRect.width = styles.fontClip.CalcSize(content).x + k_LockTextPadding; textRect.x += (trackRect.width - textRect.width) / 2f; textRect.height -= 4f; textRect.y += 2f; TimelineWindow.instance.OverlayDrawData.Add(TimelineWindow.OverlayData.CreateTextBoxOverlay(GUIClip.Unclip(textRect), content.text, styles.fontClip, Color.white, styles.customSkin.colorLockTextBG, styles.displayBackground)); }
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)); }