The GetValue
method retrieves the value of a serialized property. If the property does not have a value, it returns the specified defaultValue
.
The GetValue
method retrieves the value of a serialized property. If the property does not have a value, it returns the specified defaultValue
.
Use this method when you need to obtain the value of a serialized property, with the option to specify a default value in case the property is not set.
// Assuming 'property' is an instance of SerializedProperty int defaultValue = 10; int value = property.GetValue(defaultValue); // 'value' will be the property's value if set, otherwise it will be 10.