diff options
| author | Andrew Lee <alee14498@protonmail.com> | 2020-04-19 17:19:32 -0400 |
|---|---|---|
| committer | Andrew Lee <alee14498@protonmail.com> | 2020-04-19 17:19:32 -0400 |
| commit | c55fba8ab2a1c9d3df65eda4a5a1e957f4aa1f78 (patch) | |
| tree | ee4d51c7c1d633e11f46453ef1edd3c77c4ef9f7 /Library/PackageCache/com.unity.timeline@1.2.13/Editor/Utilities/CustomTrackDrawerAttribute.cs | |
| download | Project-Sandbox-c55fba8ab2a1c9d3df65eda4a5a1e957f4aa1f78.tar.gz Project-Sandbox-c55fba8ab2a1c9d3df65eda4a5a1e957f4aa1f78.tar.bz2 Project-Sandbox-c55fba8ab2a1c9d3df65eda4a5a1e957f4aa1f78.zip | |
Inital commit
Diffstat (limited to 'Library/PackageCache/com.unity.timeline@1.2.13/Editor/Utilities/CustomTrackDrawerAttribute.cs')
| -rw-r--r-- | Library/PackageCache/com.unity.timeline@1.2.13/Editor/Utilities/CustomTrackDrawerAttribute.cs | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/Library/PackageCache/com.unity.timeline@1.2.13/Editor/Utilities/CustomTrackDrawerAttribute.cs b/Library/PackageCache/com.unity.timeline@1.2.13/Editor/Utilities/CustomTrackDrawerAttribute.cs new file mode 100644 index 0000000..021a635 --- /dev/null +++ b/Library/PackageCache/com.unity.timeline@1.2.13/Editor/Utilities/CustomTrackDrawerAttribute.cs @@ -0,0 +1,47 @@ +using System; + +namespace UnityEditor.Timeline +{ + // Tells a custom [[TrackDrawer]] which [[TrackAsset]] it's a drawer for. + sealed class CustomTrackDrawerAttribute : Attribute + { + public Type assetType; + public CustomTrackDrawerAttribute(Type type) + { + assetType = type; + } + } + + /// <summary> + /// Attribute that specifies a class as an editor for an extended Timeline type. + /// </summary> + /// <remarks> + /// 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. + /// </remarks> + /// <example> + /// [CustomTimelineEditor(typeof(LightControlClip))] + /// class LightControlClipEditor : ClipEditor + /// { + /// } + /// </example> + [AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = true)] + public sealed class CustomTimelineEditorAttribute : Attribute + { + /// <summary> + /// The type that that this editor applies to. + /// </summary> + public Type classToEdit { get; private set; } + + /// <summary> + /// Constructor. + /// </summary> + /// <param name="type"> The type that that this editor applies to.</param> + /// <exception cref="ArgumentNullException">Thrown if type is null</exception> + public CustomTimelineEditorAttribute(Type type) + { + if (type == null) + throw new System.ArgumentNullException(nameof(type)); + classToEdit = type; + } + } +} |
