docs.unity.cn
    Show / Hide Table of Contents

    Class TimelineShortcutAttribute

    Use this attribute to make an action work with the shortcut system.

    Inheritance
    Object
    Attribute
    ShortcutBaseAttribute
    ShortcutAttribute
    TimelineShortcutAttribute
    Inherited Members
    ShortcutAttribute.displayName
    Attribute.GetCustomAttributes(MemberInfo, Type)
    Attribute.GetCustomAttributes(MemberInfo, Type, Boolean)
    Attribute.GetCustomAttributes(MemberInfo)
    Attribute.GetCustomAttributes(MemberInfo, Boolean)
    Attribute.IsDefined(MemberInfo, Type)
    Attribute.IsDefined(MemberInfo, Type, Boolean)
    Attribute.GetCustomAttribute(MemberInfo, Type)
    Attribute.GetCustomAttribute(MemberInfo, Type, Boolean)
    Attribute.GetCustomAttributes(ParameterInfo)
    Attribute.GetCustomAttributes(ParameterInfo, Type)
    Attribute.GetCustomAttributes(ParameterInfo, Type, Boolean)
    Attribute.GetCustomAttributes(ParameterInfo, Boolean)
    Attribute.IsDefined(ParameterInfo, Type)
    Attribute.IsDefined(ParameterInfo, Type, Boolean)
    Attribute.GetCustomAttribute(ParameterInfo, Type)
    Attribute.GetCustomAttribute(ParameterInfo, Type, Boolean)
    Attribute.GetCustomAttributes(Module, Type)
    Attribute.GetCustomAttributes(Module)
    Attribute.GetCustomAttributes(Module, Boolean)
    Attribute.GetCustomAttributes(Module, Type, Boolean)
    Attribute.IsDefined(Module, Type)
    Attribute.IsDefined(Module, Type, Boolean)
    Attribute.GetCustomAttribute(Module, Type)
    Attribute.GetCustomAttribute(Module, Type, Boolean)
    Attribute.GetCustomAttributes(Assembly, Type)
    Attribute.GetCustomAttributes(Assembly, Type, Boolean)
    Attribute.GetCustomAttributes(Assembly)
    Attribute.GetCustomAttributes(Assembly, Boolean)
    Attribute.IsDefined(Assembly, Type)
    Attribute.IsDefined(Assembly, Type, Boolean)
    Attribute.GetCustomAttribute(Assembly, Type)
    Attribute.GetCustomAttribute(Assembly, Type, Boolean)
    Attribute.Equals(Object)
    Attribute.GetHashCode()
    Attribute.Match(Object)
    Attribute.IsDefaultAttribute()
    Attribute._Attribute.GetTypeInfoCount(UInt32)
    Attribute._Attribute.GetTypeInfo(UInt32, UInt32, IntPtr)
    Attribute._Attribute.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr)
    Attribute._Attribute.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr)
    Attribute.TypeId
    Object.ToString()
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: UnityEditor.Timeline.Actions
    Syntax
    public class TimelineShortcutAttribute : ShortcutAttribute, _Attribute
    Examples

    TimelineShortcutAttribute needs to be added to a static method.

        public class ShortcutAction : TimelineAction
        {
            public override ActionValidity Validate(ActionContext _)
            {
                return ActionValidity.Valid;
            }
    
            public override bool Execute(ActionContext _)
            {
                Debug.Log("Action executed.");
                return true;
            }
    
            [TimelineShortcut("Test Action", KeyCode.K, ShortcutModifiers.Shift | ShortcutModifiers.Alt)]
            public static void HandleShortCut(ShortcutArguments args)
            {
                Invoker.InvokeWithSelected<ShortcutAction>();
            }
        }

    Constructors

    TimelineShortcutAttribute(String, KeyCode, ShortcutModifiers)

    TimelineShortcutAttribute Constructor

    Declaration
    public TimelineShortcutAttribute(string id, KeyCode defaultKeyCode, ShortcutModifiers defaultShortcutModifiers = ShortcutModifiers.None)
    Parameters
    Type Name Description
    String id

    Id to register the shortcut. It will automatically be prefix by 'Timeline/' in order to be in the 'Timeline' section of the shortcut manager.

    KeyCode defaultKeyCode

    Optional key code for default binding.

    ShortcutModifiers defaultShortcutModifiers

    Optional shortcut modifiers for default binding.

    Back to top Copyright © 2023 Unity Technologies — Terms of use
    Generated by DocFX
    on Wednesday, June 21, 2023