暂无描述
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

TimelineAction.cs 1.6KB

12345678910111213141516171819202122232425262728293031323334
  1. namespace 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. /// <summary>
  27. /// Defines the validity of an Action based on the context.
  28. /// </summary>
  29. /// <param name="context">Context for the action.</param>
  30. /// <returns>Visual state of the menu for the action.</returns>
  31. public abstract ActionValidity Validate(ActionContext context);
  32. }
  33. }