System.Type PropertyType { get; set; }

book_4_sparkGenerated
code_blocksInput

Description

The PropertyType property of the SerializedProperty class represents the type of the property being serialized. This property is of type System.Type and provides information about the data type of the serialized property.

Usage

Use the PropertyType property to determine the data type of a serialized property. This can be useful when you need to perform type-specific operations or validations on the property value.

Example

// Example of accessing the PropertyType property
SerializedProperty serializedProperty = ...; // Assume this is an initialized SerializedProperty object
Type propertyType = serializedProperty.PropertyType;

// Check if the property type is a specific type
if (propertyType == typeof(int))
{
    // Handle integer-specific logic
}
else if (propertyType == typeof(string))
{
    // Handle string-specific logic
}