Add option to use seconds for timeline/media duration

This commit is contained in:
Wojtek Figat
2021-08-03 12:05:47 +02:00
parent b5d2b39c3e
commit c9b87d9b76
2 changed files with 28 additions and 4 deletions

View File

@@ -141,15 +141,27 @@ namespace FlaxEditor.GUI.Timeline
public TTimeline Timeline;
/// <summary>
/// Gets or sets the total duration of the timeline in the frames amount.
/// Gets or sets the total duration of the timeline (in frames).
/// </summary>
[EditorDisplay("General"), EditorOrder(10), Limit(1), Tooltip("Total duration of the timeline event the frames amount.")]
[EditorDisplay("General"), EditorOrder(10), Limit(1), VisibleIf(nameof(UseFrames)), Tooltip("Total duration of the timeline (in frames).")]
public int DurationFrames
{
get => Timeline.DurationFrames;
set => Timeline.DurationFrames = value;
}
/// <summary>
/// Gets or sets the total duration of the timeline (in seconds).
/// </summary>
[EditorDisplay("General"), EditorOrder(10), Limit(0.0f, float.MaxValue, 0.001f), VisibleIf(nameof(UseFrames), true), Tooltip("Total duration of the timeline (in seconds).")]
public float Duration
{
get => Timeline.Duration;
set => Timeline.Duration = value;
}
private bool UseFrames => Timeline.TimeShowMode == TimeShowModes.Frames;
/// <summary>
/// Initializes a new instance of the <see cref="ProxyBase{TTimeline}"/> class.
/// </summary>