Description
The NotePreChange
method is a virtual method of the SerializedObject
class. It is used to notify the system that a change is about to occur on a specified SerializedProperty
. This method is typically called before any modifications are made to the property, allowing for any necessary pre-change logic to be executed.
Usage
To use the NotePreChange
method, you need to have an instance of a class that derives from SerializedObject
. You can then call this method, passing in the SerializedProperty
that is about to be changed.
This method is particularly useful in scenarios where you need to perform actions or checks before a property is modified, such as logging, validation, or triggering events.
Example
// Assuming 'serializedObject' is an instance of a class derived from SerializedObject
// and 'property' is a SerializedProperty that is about to be changed.
serializedObject.NotePreChange(property);
// Proceed with changes to 'property' after calling NotePreChange.