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

NameDescription
Public methodReadOnlyAttribute

Properties

NameDescription
Public propertyHideInEditMode Whether to hide the variable during edit-mode.
Public propertyOnlyWhilePlaying Whether to apply the read-only mode only while playing.

Extension Methods

NameDescription
Public Extension MethodThrowIfNull Throws an exception if the object is null. (Defined by ObjectExt.)

See Also

Reference

UltimateXR.Attributes Namespace