Class AnimationClipEditScope
One user gesture's worth of undo/dirty bracketing around a native curve mutation on an
UnityEngine.AnimationClip. Uses UnityEditor.Undo.RegisterCompleteObjectUndo(UnityEngine.Object,System.String)
deliberately instead of UnityEditor.Undo.RecordObject(UnityEngine.Object,System.String): the AnimationUtility.SetEditorCurve family
mutates the clip's native serialized curve data in one bulk native call, entirely outside the small set of
managed fields RecordObject's diff recorder tracks between a "record" and a later modification — only
RegisterCompleteObjectUndo's full-object snapshot actually captures the before/after state those
calls produce. Write(AnimationClip, ClipSettingsView, string) already established this same idiom for the
clip's settings block; every curve-mutating call in AnimationClipCurveEditingEngine wraps
itself in exactly one of these scopes — one scope per user gesture, never shared across several.
Implements
Inherited Members
Namespace: Serenity.Editor.AnimationHub.Engine
Assembly: Serenity.AnimationHub.Editor.dll
Syntax
public sealed class AnimationClipEditScope : IDisposable
Constructors
AnimationClipEditScope(AnimationClip, string)
Declaration
public AnimationClipEditScope(AnimationClip clip, string undoLabel)
Parameters
| Type | Name | Description |
|---|---|---|
| AnimationClip | clip | |
| string | undoLabel |
Methods
Dispose()
Marks the clip dirty so the editor persists the mutation. Deliberately does not call UnityEditor.AssetDatabase.SaveAssets — a caller batching several scopes into one gesture (for example several key edits from one drag) saves once itself after the whole gesture completes.
Declaration
public void Dispose()