No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

CustomTrackDrawerAttribute.cs 1.6KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. using System;
  2. namespace UnityEditor.Timeline
  3. {
  4. // Tells a custom [[TrackDrawer]] which [[TrackAsset]] it's a drawer for.
  5. sealed class CustomTrackDrawerAttribute : Attribute
  6. {
  7. public Type assetType;
  8. public CustomTrackDrawerAttribute(Type type)
  9. {
  10. assetType = type;
  11. }
  12. }
  13. /// <summary>
  14. /// Attribute that specifies a class as an editor for an extended Timeline type.
  15. /// </summary>
  16. /// <remarks>
  17. /// Use this attribute on a class that extends ClipEditor, TrackEditor, or MarkerEditor to specify either the PlayableAsset, Marker, or TrackAsset derived classes for associated customization.
  18. /// </remarks>
  19. /// <example>
  20. /// <code source="../../DocCodeExamples/TimelineAttributesExamples.cs" region="declare-customTimelineEditorAttr" title="customTimelineEditorAttr"/>
  21. /// </example>
  22. [AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = true)]
  23. public sealed class CustomTimelineEditorAttribute : Attribute
  24. {
  25. /// <summary>
  26. /// The type that that this editor applies to.
  27. /// </summary>
  28. public Type classToEdit { get; private set; }
  29. /// <summary>
  30. /// Constructor.
  31. /// </summary>
  32. /// <param name="type"> The type that that this editor applies to.</param>
  33. /// <exception cref="ArgumentNullException">Thrown if type is null</exception>
  34. public CustomTimelineEditorAttribute(Type type)
  35. {
  36. if (type == null)
  37. throw new System.ArgumentNullException(nameof(type));
  38. classToEdit = type;
  39. }
  40. }
  41. }