Description
The RecordChange
method is part of the Editor.SceneEditorSession
class. It is used to record changes made to a serialized property within the scene editor session. This method is marked as obsolete, indicating that it should not be used in new code as it may be removed in future versions. Instead, developers are encouraged to use alternative methods for handling changes and undo operations.
Usage
To use the RecordChange
method, you need to pass a Sandbox.SerializedProperty
object as a parameter. This method is virtual, sealed, and public, meaning it can be called on instances of SceneEditorSession
, but cannot be overridden in derived classes.
Note: Since this method is obsolete, consider using the AddUndo
or UndoScope
methods for managing changes and undo operations in the scene editor session.
Example
// Example usage of RecordChange (not recommended due to obsolescence)
Editor.SceneEditorSession session = new Editor.SceneEditorSession();
Sandbox.SerializedProperty property = new Sandbox.SerializedProperty();
// Record a change to the property
session.RecordChange(property);
// Recommended alternative
session.AddUndo("Change Property",
() => { /* undo action */ },
() => { /* redo action */ });