Keine Beschreibung
Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

ApplyDefaultUndoAttribute.cs 1.7KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. using System;
  2. namespace UnityEditor.Timeline.Actions
  3. {
  4. /// <summary>
  5. /// Use this attribute on action classes (<see cref="TimelineAction"/>,
  6. /// <see cref="ClipAction"/>,
  7. /// <see cref="MarkerAction"/> and
  8. /// <see cref="TrackAction"/>)
  9. /// to have the default undo behaviour applied.
  10. ///
  11. /// By default, applying this attribute will record all objects passed to the Execute method with the Undo system,
  12. /// using the name of Action it is applied to.
  13. ///
  14. /// <example>
  15. /// Simple track Action example (with context menu and shortcut support).
  16. /// <code source="../../DocCodeExamples/TimelineAttributesExamples.cs" region="declare-applyDefaultUndoAttr" title="ApplyDefaultUndoAttr"/>
  17. /// </example>
  18. /// </summary>
  19. /// <seealso cref="TimelineAction"/>
  20. /// <seealso cref="TrackAction"/>
  21. /// <seealso cref="ClipAction"/>
  22. /// <seealso cref="MarkerAction"/>
  23. [AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)]
  24. public class ApplyDefaultUndoAttribute : Attribute
  25. {
  26. /// <summary>
  27. /// The title of the action to appear in the undo history. If not specified, the name is taken from the DisplayName attribute,
  28. /// or derived from the name of the class this attribute is applied to.
  29. /// </summary>
  30. public string UndoTitle;
  31. /// <summary>Use this attribute on action classes to have the default undo behaviour applied.
  32. /// </summary>
  33. /// <param name="undoTitle">The title of the action to appear in the undo history.</param>
  34. public ApplyDefaultUndoAttribute(string undoTitle = null)
  35. {
  36. UndoTitle = undoTitle;
  37. }
  38. }
  39. }