SW 중심대학 OSS GIT 서버 박건태, 이승준, 고기완, 이준호 새로운 배포
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.

47 lines
1.6 KiB

4 years ago
  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. /// [CustomTimelineEditor(typeof(LightControlClip))]
  21. /// class LightControlClipEditor : ClipEditor
  22. /// {
  23. /// }
  24. /// </example>
  25. [AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = true)]
  26. public sealed class CustomTimelineEditorAttribute : Attribute
  27. {
  28. /// <summary>
  29. /// The type that that this editor applies to.
  30. /// </summary>
  31. public Type classToEdit { get; private set; }
  32. /// <summary>
  33. /// Constructor.
  34. /// </summary>
  35. /// <param name="type"> The type that that this editor applies to.</param>
  36. /// <exception cref="ArgumentNullException">Thrown if type is null</exception>
  37. public CustomTimelineEditorAttribute(Type type)
  38. {
  39. if (type == null)
  40. throw new System.ArgumentNullException(nameof(type));
  41. classToEdit = type;
  42. }
  43. }
  44. }