Нет описания
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

MarkerAction.cs 1.7KB

1234567891011121314151617181920212223242526272829303132333435
  1. using System.Collections.Generic;
  2. using UnityEngine.Timeline;
  3. namespace UnityEditor.Timeline.Actions
  4. {
  5. /// <summary>
  6. /// Base class for a marker action.
  7. /// Inherit from this class to make an action that would react on selected markers after a menu click and/or a key shortcut.
  8. /// </summary>
  9. /// <example>
  10. /// Simple track Action example (with context menu and shortcut support).
  11. /// <code source="../../DocCodeExamples/ActionExamples.cs" region="declare-sampleMarkerAction" title="SampleMarkerAction"/>
  12. /// </example>
  13. /// <remarks>
  14. /// To add an action as a menu item in the Timeline context menu, add <see cref="MenuEntryAttribute"/> on the action class.
  15. /// To make an action to react to a shortcut, use the Shortcut Manager API with <see cref="TimelineShortcutAttribute"/>.
  16. /// <seealso cref="UnityEditor.ShortcutManagement.ShortcutAttribute"/>
  17. /// </remarks>
  18. [ActiveInMode(TimelineModes.Default)]
  19. public abstract class MarkerAction : IAction
  20. {
  21. /// <summary>
  22. /// Execute the action.
  23. /// </summary>
  24. /// <param name="markers">Markers that will be used for the action. </param>
  25. /// <returns>true if the action has been executed. false otherwise</returns>
  26. public abstract bool Execute(IEnumerable<IMarker> markers);
  27. /// <summary>
  28. /// Defines the validity of an Action for a given set of markers.
  29. /// </summary>
  30. /// <param name="markers">Markers that will be used for the action. </param>
  31. /// <returns>The validity of the set of markers.</returns>
  32. public abstract ActionValidity Validate(IEnumerable<IMarker> markers);
  33. }
  34. }