static void DrawMuteButton(Rect rect) { if (GUI.Button(rect, GUIContent.none, TimelineWindow.styles.markerHeaderMuteButton)) { Action.InvokeWithSelected <ToggleMuteMarkersOnTimeline>(); } }
static void DrawLockButton(Rect rect) { if (GUI.Button(rect, GUIContent.none, TimelineWindow.styles.trackLockButton)) { Action.InvokeWithSelected <ToggleShowMarkersOnTimeline>(); } }
public TimeAreaItem(GUIStyle style, Action <double> onDrag) { m_Style = style; headColor = Color.white; var scrub = new Scrub( (evt, state) => { firstDrag = true; return(state.timeAreaRect.Contains(evt.mousePosition) && bounds.Contains(evt.mousePosition)); }, (d) => { if (onDrag != null) { onDrag(d); } firstDrag = false; }, () => { showTooltip = false; firstDrag = false; } ); AddManipulator(scrub); lineColor = m_Style.normal.textColor; drawLine = true; drawHead = true; canMoveHead = false; tooltip = string.Empty; boundOffset = Vector2.zero; m_Tooltip = new Tooltip(DirectorStyles.Instance.displayBackground, DirectorStyles.Instance.tinyFont); }
public Scrub(Func <Event, WindowState, bool> onMouseDown, Action <double> onMouseDrag, System.Action onMouseUp) { m_OnMouseDown = onMouseDown; m_OnMouseDrag = onMouseDrag; m_OnMouseUp = onMouseUp; }
internal static void AddTimeAreaMenuItems(GenericMenu menu, WindowState state) { foreach (var value in Enum.GetValues(typeof(TimelineAsset.DurationMode))) { var mode = (TimelineAsset.DurationMode)value; var item = EditorGUIUtility.TextContent(string.Format(TimelineWindow.Styles.DurationModeText, L10n.Tr(ObjectNames.NicifyVariableName(mode.ToString())))); if (state.recording || state.IsEditingASubTimeline() || state.editSequence.asset == null || state.editSequence.isReadOnly) { menu.AddDisabledItem(item); } else { menu.AddItem(item, state.editSequence.asset.durationMode == mode, () => SelectDurationCallback(state, mode)); } menu.AddItem(DirectorStyles.showMarkersOnTimeline, state.showMarkerHeader, () => Action.InvokeWithSelected <ToggleShowMarkersOnTimeline>()); } }