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.

37 lines
1.0 KiB

4 years ago
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using UnityEngine;
  5. namespace UnityEditor.Timeline
  6. {
  7. /// <summary>
  8. /// Used to indicate path and priority of classes that are auto added to the menu
  9. /// </summary>
  10. [AttributeUsage(AttributeTargets.Class)]
  11. internal class MenuEntryAttribute : Attribute
  12. {
  13. public readonly int priority;
  14. public readonly string name;
  15. public readonly string subMenuPath;
  16. public MenuEntryAttribute(string path, int priority)
  17. {
  18. path = path ?? string.Empty;
  19. path = L10n.Tr(path);
  20. this.priority = priority;
  21. int index = path.LastIndexOf('/');
  22. if (index >= 0)
  23. {
  24. name = (index == path.Length - 1) ? string.Empty : path.Substring(index + 1);
  25. subMenuPath = path.Substring(0, index + 1);
  26. }
  27. else
  28. {
  29. name = path;
  30. subMenuPath = string.Empty;
  31. }
  32. }
  33. }
  34. }