ReadOnlyAttribute Class
Attribute to visualize inspector fields as read-only so that they can’t be edited. This can be used for debugging purposes, to expose component information to the user but without the possibility to edit the data. It also provides additional functionality:
- Make the field read-only during play mode but editable during edit mode.
- Hide the field during edit-mode.
Inheritance Hierarchy
System.Object
System.Attribute
PropertyAttribute
UltimateXR.Attributes.ReadOnlyAttribute
Namespace: UltimateXR.Attributes
Assembly: UltimateXR (in UltimateXR.dll) Version: 0.0.0.0
Syntax
C#
public class ReadOnlyAttribute : PropertyAttribute
The ReadOnlyAttribute type exposes the following members.
Constructors
Name | Description | |
---|---|---|
ReadOnlyAttribute |
Properties
Name | Description | |
---|---|---|
HideInEditMode | Whether to hide the variable during edit-mode. | |
OnlyWhilePlaying | Whether to apply the read-only mode only while playing. |
Extension Methods
Name | Description | |
---|---|---|
ThrowIfNull | Throws an exception if the object is null. (Defined by ObjectExt.) |