Description
The NullableType
property of the SerializedProperty
class provides the underlying type of a nullable property. If the property is a nullable type, this property will return the type that is being made nullable. For example, if the property is of type int?
, the NullableType
will return int
.
Usage
Use the NullableType
property to determine the base type of a nullable property. This can be useful when you need to perform operations that require knowledge of the underlying type, such as reflection or type conversion.
Example
// Example usage of NullableType property
SerializedProperty property = ...; // Assume this is initialized
if (property.IsNullable)
{
System.Type nullableBaseType = property.NullableType;
// Perform operations with nullableBaseType
}