API reference
API reference
Select your platform
No SDKs available
No versions available

MemberInfoExtensions Class

Public extension methods for MemberInfo that provide unified access to fields, properties, and methods.
This utility class simplifies reflection operations by providing a consistent API for accessing member information regardless of whether the member is a field, property, or method. It's designed to work seamlessly with the Immersive Debugger's inspection and tweaking systems.
These extensions are particularly useful for:
  • Runtime component inspection and modification
  • Dynamic UI generation for debugging interfaces
  • Type-safe reflection operations with proper error handling
  • Integration with AI agents and automated debugging tools

Static Member Functions

Gets the value of a field or property from the specified instance.
This method provides a unified way to retrieve values from both fields and properties, handling the underlying reflection differences automatically.
Parameters
memberInfo
The MemberInfo representing the field or property to read from
instance
The object instance to read the value from
Returns
The value of the member, or null if the member cannot be read or an error occurs
Sets the value of a field or property on the specified instance.
This method provides a unified way to modify values for both fields and properties, handling the underlying reflection differences automatically. It's essential for runtime tweaking and dynamic component modification in debugging scenarios.
Parameters
memberInfo
The MemberInfo representing the field or property to write to
instance
The object instance to modify
value
The new value to assign to the member
Gets the data type of a field or property.
This method provides a unified way to retrieve the type information from both fields and properties, which is essential for type-safe operations and UI generation.
Parameters
memberInfo
The MemberInfo representing the field or property
Returns
The Type of the field or property, or null if the member is not a field or property
Determines whether a field, property, or method is static.
This method provides a unified way to check if a member is static across different member types, which is important for determining how to access the member (instance vs static access).
Parameters
memberInfo
The MemberInfo to check
Returns
True if the member is static, false otherwise
Determines whether a field, property, or method is public.
This method provides a unified way to check accessibility across different member types, which is crucial for filtering members that should be exposed in debugging interfaces.
Parameters
memberInfo
The MemberInfo to check
Returns
True if the member is public, false otherwise
Builds a formatted signature string for display in the debug inspector UI.
This method creates human-readable signatures that include access modifiers, types, and member names with HTML formatting for rich text display in debugging interfaces.
Parameters
memberInfo
The MemberInfo to create a signature for
Returns
A formatted HTML string representing the member signature
Determines whether a member is compatible with the Immersive Debugger's inspection system.
This method applies comprehensive filtering to determine if a member should be exposed in debugging interfaces. It's a core method used throughout the Immersive Debugger to ensure only appropriate members are shown to users and AI agents.
Parameters
memberInfo
The MemberInfo to check for compatibility
Returns
True if the member is compatible with debug inspection, false otherwise
Determines whether a field or property has the exact specified type.
This method provides a unified way to check if a member's type matches exactly with a given type, which is useful for type-specific filtering and operations.
Parameters
member
The MemberInfo to check
type
The Type to compare against
Returns
True if the member's type exactly matches the specified type, false otherwise
Determines whether a field or property's base type matches the specified type.
This method checks if the member's type inherits from or has the specified base type, which is useful for inheritance-based filtering and polymorphic operations.
Parameters
member
The MemberInfo to check
type
The base Type to compare against
Returns
True if the member's base type matches the specified type, false otherwise
Determines whether a member can be modified (is settable).
This method provides a quick way to check if a member supports value modification, which is essential for determining which members can be tweaked in debugging interfaces.
Parameters
memberInfo
The MemberInfo to check
Returns
True if the member is a field or property that can potentially be changed, false otherwise