A game about forced loneliness, made by TACStudios
1namespace UnityEditor.Timeline.Actions
2{
3 /// <summary>
4 /// Base class for a timeline action.
5 /// Inherit from this class to make an action on a timeline after a menu click and/or a key shortcut.
6 /// </summary>
7 /// <remarks>
8 /// To add an action as a menu item in the Timeline context menu, add <see cref="MenuEntryAttribute"/> on the action class.
9 /// To make an action to react to a shortcut, use the Shortcut Manager API with <see cref="TimelineShortcutAttribute"/>.
10 /// <seealso cref="UnityEditor.ShortcutManagement.ShortcutAttribute"/>
11 /// <seealso cref="ActiveInModeAttribute"/>
12 /// </remarks>
13 /// <example>
14 /// Simple Timeline Action example (with context menu and shortcut support).
15 /// <code source="../../DocCodeExamples/ActionExamples.cs" region="declare-sampleTimelineAction" title="SampleTimelineAction"/>
16 /// </example>
17 [ActiveInMode(TimelineModes.Default)]
18 public abstract class TimelineAction : IAction
19 {
20 /// <summary>
21 /// Execute the action.
22 /// </summary>
23 /// <param name="context">Context for the action.</param>
24 /// <returns>true if the action has been executed. false otherwise</returns>
25 public abstract bool Execute(ActionContext context);
26
27 /// <summary>
28 /// Defines the validity of an Action based on the context.
29 /// </summary>
30 /// <param name="context">Context for the action.</param>
31 /// <returns>Visual state of the menu for the action.</returns>
32 public abstract ActionValidity Validate(ActionContext context);
33 }
34}