From c55fba8ab2a1c9d3df65eda4a5a1e957f4aa1f78 Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Sun, 19 Apr 2020 17:19:32 -0400 Subject: Inital commit --- .../Editor/Attributes/MenuEntryAttribute.cs | 37 ++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 Library/PackageCache/com.unity.timeline@1.2.13/Editor/Attributes/MenuEntryAttribute.cs (limited to 'Library/PackageCache/com.unity.timeline@1.2.13/Editor/Attributes/MenuEntryAttribute.cs') diff --git a/Library/PackageCache/com.unity.timeline@1.2.13/Editor/Attributes/MenuEntryAttribute.cs b/Library/PackageCache/com.unity.timeline@1.2.13/Editor/Attributes/MenuEntryAttribute.cs new file mode 100644 index 0000000..29623d2 --- /dev/null +++ b/Library/PackageCache/com.unity.timeline@1.2.13/Editor/Attributes/MenuEntryAttribute.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace UnityEditor.Timeline +{ + /// + /// Used to indicate path and priority of classes that are auto added to the menu + /// + [AttributeUsage(AttributeTargets.Class)] + internal class MenuEntryAttribute : Attribute + { + public readonly int priority; + public readonly string name; + public readonly string subMenuPath; + + public MenuEntryAttribute(string path, int priority) + { + path = path ?? string.Empty; + path = L10n.Tr(path); + this.priority = priority; + + int index = path.LastIndexOf('/'); + if (index >= 0) + { + name = (index == path.Length - 1) ? string.Empty : path.Substring(index + 1); + subMenuPath = path.Substring(0, index + 1); + } + else + { + name = path; + subMenuPath = string.Empty; + } + } + } +} -- cgit v1.2.3