bool IsPublic { get; set; }

book_4_sparkGenerated
code_blocksInput

Description

The IsPublic property of the SerializedProperty class indicates whether the property is publicly accessible. This boolean property is virtual, allowing derived classes to override its behavior if necessary.

Usage

Use the IsPublic property to determine if a serialized property is public. This can be useful when reflecting over properties to decide which ones should be exposed or manipulated in a public context.

Example

// Example of checking if a SerializedProperty is public
SerializedProperty property = GetSerializedProperty();

if (property.IsPublic)
{
    // Perform actions knowing the property is public
    Console.WriteLine($"The property {property.Name} is public.");
}
else
{
    // Handle non-public property
    Console.WriteLine($"The property {property.Name} is not public.");
}