bool IsMethod { get; set; }

robot_2Generated
code_blocksInput

Description

The IsMethod property of the SerializedProperty class indicates whether the serialized property represents a method. This property returns a boolean value, where true signifies that the property is a method, and false indicates otherwise.

Usage

Use the IsMethod property when you need to determine if a SerializedProperty instance is a method. This can be particularly useful when iterating over properties and you need to handle methods differently from fields or properties.

Example

// Example usage of the IsMethod property
SerializedProperty property = GetSerializedProperty();

if (property.IsMethod)
{
    // Handle the property as a method
    property.Invoke();
}
else
{
    // Handle the property as a field or property
    var value = property.GetValue(defaultValue);
}