Class MenuEntryAttribute
Use this attribute to add a menu item to a context menu. Used to indicate path and priority that are auto added to the menu (examples can be found on https://docs.unity3d.com/ScriptReference/MenuItem.html).
Implements
Inherited Members
Namespace: UnityEditor.Timeline.Actions
Assembly: solution.dll
Syntax
[AttributeUsage(AttributeTargets.Class)]
public class MenuEntryAttribute : Attribute, _Attribute
Remarks
Unlike Menu item, MenuEntryAttribute doesn't handle shortcuts in the menu name. See TimelineShortcutAttribute.
Examples
[MenuEntry("Simple Menu Action")]
class SimpleMenuAction : TimelineAction
{
public override ActionValidity Validate(ActionContext actionContext)
{
return ActionValidity.Valid;
}
public override bool Execute(ActionContext actionContext)
{
return true;
}
}
[MenuEntry("Menu Action with priority", 9999)]
class MenuActionWithPriority : TimelineAction
{
public override ActionValidity Validate(ActionContext actionContext)
{
return ActionValidity.Valid;
}
public override bool Execute(ActionContext actionContext)
{
return true;
}
}
[MenuEntry("My Menu/Menu Action inside submenu")]
class MenuActionInsideSubMenu : TimelineAction
{
public override ActionValidity Validate(ActionContext actionContext)
{
return ActionValidity.Valid;
}
public override bool Execute(ActionContext actionContext)
{
return true;
}
}
Constructors
Name | Description |
---|---|
MenuEntryAttribute(string, int) | Constructor for Menu Entry Attribute to define information about the menu item for an action. |