Class MarkerAction
Base class for a marker action. Inherit from this class to make an action that would react on selected markers after a menu click and/or a key shortcut.
상속된 멤버
네임스페이스: UnityEditor.Timeline.Actions
어셈블리: solution.dll
구문
[ActiveInMode(TimelineModes.Default)]
public abstract class MarkerAction
참고
To add an action as a menu item in the Timeline context menu, add MenuEntryAttribute on the action class. To make an action to react to a shortcut, use the Shortcut Manager API with TimelineShortcutAttribute. ShortcutAttribute
예
Simple track Action example (with context menu and shortcut support).
[MenuEntry("Custom Actions/Sample marker Action")]
public class SampleMarkerAction : MarkerAction
{
public override ActionValidity Validate(IEnumerable<IMarker> markers)
{
return ActionValidity.Valid;
}
public override bool Execute(IEnumerable<IMarker> items)
{
Debug.Log("Test Action");
return true;
}
[TimelineShortcut("SampleMarkerAction", KeyCode.L)]
public static void HandleShortCut(ShortcutArguments args)
{
Invoker.InvokeWithSelectedMarkers<SampleMarkerAction>();
}
}
메서드
이름 | 설명 |
---|---|
Execute(IEnumerable<IMarker>) | Execute the action. |
Validate(IEnumerable<IMarker>) | Defines the validity of an Action for a given set of markers. |