void UpdateDrawData() { if (Event.current.type == EventType.Layout) { try { m_MarkerDrawOptions = m_Editor.GetMarkerOptions(marker); } catch (Exception e) { Debug.LogException(e); m_MarkerDrawOptions = CustomTimelineEditorCache.GetDefaultMarkerEditor().GetMarkerOptions(marker); } } }
static void DrawMarker(Rect drawRect, Type type, bool isSelected, bool isCollapsed, MarkerDrawOptions options) { if (Event.current.type == EventType.Repaint) { bool hasError = !string.IsNullOrEmpty(options.errorText); var style = StyleManager.UssStyleForType(type); style.Draw(drawRect, GUIContent.none, false, false, !isCollapsed, isSelected); // case1141836: Use of GUI.Box instead of GUI.Label causes desync in UI controlID if (hasError) { GUI.Label(drawRect, String.Empty, DirectorStyles.Instance.markerWarning); } var tooltip = hasError ? options.errorText : options.tooltip; if (!string.IsNullOrEmpty(tooltip) && drawRect.Contains(Event.current.mousePosition)) { GUIStyle.SetMouseTooltip(tooltip, drawRect); } } }
public bool Equals(MarkerDrawOptions other) { return(errorText == other.errorText && tooltip == other.tooltip); }