Class ApplyDefaultUndoAttribute
Use this attribute on action classes (TimelineAction, ClipAction, MarkerAction and TrackAction) to have the default undo behaviour applied.
By default, applying this attribute will record all objects passed to the Execute method with the Undo system, using the name of Action it is applied to.
[ApplyDefaultUndo]
public class SetNameToTypeAction : TrackAction
{
public override ActionValidity Validate(IEnumerable<TrackAsset> items)
{
return ActionValidity.Valid;
}
public override bool Execute(IEnumerable<TrackAsset> items)
{
foreach (TrackAsset track in items)
track.name = track.GetType().Name;
return true;
}
}
구현
상속된 멤버
네임스페이스: UnityEditor.Timeline.Actions
어셈블리: solution.dll
구문
[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)]
public class ApplyDefaultUndoAttribute : Attribute, _Attribute
생성자
이름 | 설명 |
---|---|
ApplyDefaultUndoAttribute(string) | Use this attribute on action classes to have the default undo behaviour applied. |
필드
이름 | 설명 |
---|---|
UndoTitle | The title of the action to appear in the undo history. If not specified, the name is taken from the DisplayName attribute, or derived from the name of the class this attribute is applied to. |