A game about forced loneliness, made by TACStudios
at master 44 lines 1.6 kB view raw
1using System; 2 3namespace UnityEditor.Timeline 4{ 5 // Tells a custom [[TrackDrawer]] which [[TrackAsset]] it's a drawer for. 6 sealed class CustomTrackDrawerAttribute : Attribute 7 { 8 public Type assetType; 9 public CustomTrackDrawerAttribute(Type type) 10 { 11 assetType = type; 12 } 13 } 14 15 /// <summary> 16 /// Attribute that specifies a class as an editor for an extended Timeline type. 17 /// </summary> 18 /// <remarks> 19 /// 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. 20 /// </remarks> 21 /// <example> 22 /// <code source="../../DocCodeExamples/TimelineAttributesExamples.cs" region="declare-customTimelineEditorAttr" title="customTimelineEditorAttr"/> 23 /// </example> 24 [AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = true)] 25 public sealed class CustomTimelineEditorAttribute : Attribute 26 { 27 /// <summary> 28 /// The type that that this editor applies to. 29 /// </summary> 30 public Type classToEdit { get; private set; } 31 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}