SerializedDataEditorWindow<TObject, TData> Class

Summary

[Editor-Only] A window for managing a copy of some serialized data and applying or reverting it.
Assembly
Animancer.dll
Namespace
Animancer.Editor
Base Types
  • EditorWindow
Derived Types
graph BT Type-->Base0["EditorWindow"] Type["SerializedDataEditorWindow<TObject, TData>"] class Type type-node Derived0["SerializedComponentDataEditorWindow<TObject, TData>"]-->Type click Derived0 "/animancer/api/Animancer.Editor/SerializedComponentDataEditorWindow_2" Derived1["TransitionLibraryWindow"]-->Type click Derived1 "/animancer/api/Animancer.Editor.TransitionLibraries/TransitionLibraryWindow"

Syntax

public abstract class SerializedDataEditorWindow<TObject, TData> : EditorWindow 
    where TObject : Object where TData : class, ICopyable<TData>, IEquatable<TData>, new()

Remarks

This system assumes the implementation of System.IEquatable`1 compares the values of all fields in TData.

Type Parameters

Name Description
TObject
TData

Properties

Name Value Summary
AutoApply bool
Is the "Auto Apply" toggle currently enabled?
AutoApplyPref string
The UnityEditor.EditorPrefs key for Animancer.Editor.SerializedDataEditorWindow`2.AutoApply.
Data TData
A copy of the Animancer.Editor.SerializedDataEditorWindow`2.SourceData being managed by this window.
HasDataChanged bool
Is the Animancer.Editor.SerializedDataEditorWindow`2.Data managed by this window different to the Animancer.Editor.SerializedDataEditorWindow`2.SourceData.
SourceData TData
The Animancer.Editor.SerializedDataEditorWindow`2.Data field of the Animancer.Editor.SerializedDataEditorWindow`2.SourceObject.
SourceObject TObject
The object which contains the data this class manages.
SourceObjectMightBePrefab bool
Override this to return true if the Animancer.Editor.SerializedDataEditorWindow`2.SourceObject could be part of a prefab to ensure that modifications are serialized properly.

Methods

Name Value Summary
Apply() void
Saves the edited Animancer.Editor.SerializedDataEditorWindow`2.Data into the Animancer.Editor.SerializedDataEditorWindow`2.SourceObject.
CalculateApplyRevertWidth(ButtonGroupStyles) float
Calculates the pixel width required for Animancer.Editor.SerializedDataEditorWindow`2.DoApplyRevertGUI(UnityEngine.Rect,UnityEngine.Rect,UnityEngine.Rect,Animancer.Editor.ButtonGroupStyles).
CaptureData() void
Stores a copy of the Animancer.Editor.SerializedDataEditorWindow`2.SourceData in the Animancer.Editor.SerializedDataEditorWindow`2.Data.
DoApplyRevertGUI(ButtonGroupStyles) void
Draws GUI controls for Animancer.Editor.SerializedDataEditorWindow`2.Revert, Animancer.Editor.SerializedDataEditorWindow`2.Apply, and Animancer.Editor.SerializedDataEditorWindow`2.AutoApply.
DoApplyRevertGUI(Rect, ButtonGroupStyles) void
Draws GUI controls for Animancer.Editor.SerializedDataEditorWindow`2.Revert, Animancer.Editor.SerializedDataEditorWindow`2.Apply, and Animancer.Editor.SerializedDataEditorWindow`2.AutoApply.
DoApplyRevertGUI(Rect, Rect, Rect, ButtonGroupStyles) void
Draws GUI controls for Animancer.Editor.SerializedDataEditorWindow`2.Revert, Animancer.Editor.SerializedDataEditorWindow`2.Apply, and Animancer.Editor.SerializedDataEditorWindow`2.AutoApply.
GatherObjectReferences(Object, HashSet<Object>) void
Gathers all objects referenced by the `root`.
static
OnDestroy() void
Prompts the user to Animancer.Editor.SerializedDataEditorWindow`2.Apply or Animancer.Editor.SerializedDataEditorWindow`2.Revert if there are changes in the Animancer.Editor.SerializedDataEditorWindow`2.Data when this window is closed.
OnDisable() void
Cleans up this window.
OnEnable() void
Initializes this window.
OnPlayModeStateChanged(PlayModeStateChange) void
Handles entering and exiting Play Mode.
Open<TWindow>(TObject, bool, Type[]) TWindow
Opens a new TWindow for the `sourceObject` or gives focus to an existing window that was already displaying it.
static
RecordUndo() TData
Records the current state of this window so it can be undone later.
RecordUndo(string) TData
Records the current state of this window so it can be undone later.
Revert() void
Restores the Animancer.Editor.SerializedDataEditorWindow`2.Data to the original values from the Animancer.Editor.SerializedDataEditorWindow`2.SourceData.
SetAndCaptureSource(TObject) void
Sets the Animancer.Editor.SerializedDataEditorWindow`2.SourceObject and captures the Animancer.Editor.SerializedDataEditorWindow`2.Data as a copy of its Animancer.Editor.SerializedDataEditorWindow`2.SourceData.