Description
The HasChanges
property of the SerializedProperty
class is a virtual boolean property that indicates whether the current set value of the property differs from its actual value. This property is useful for determining if a property has been modified since it was last saved or initialized.
Usage
To use the HasChanges
property, simply access it on an instance of SerializedProperty
. It will return true
if the property's current value is different from its original or last saved value, and false
otherwise.
Example
// Example usage of the HasChanges property
SerializedProperty myProperty = ...; // Assume this is initialized
if (myProperty.HasChanges)
{
// Perform actions if the property has changed
// For example, save the changes or notify the user
}