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

OptionalAttribute Class

Extends PropertyAttribute
Used on a SerializedField and surfaces the expectation that this field can remain empty.

Constructors

OptionalAttribute ()
Create a new Optional attribute with default flags.
Signature
Oculus.Interaction.OptionalAttribute.OptionalAttribute()
OptionalAttribute ( flags )
Create a new Optional attribute with the specified flags.
Signature
Oculus.Interaction.OptionalAttribute.OptionalAttribute(Flag flags)
Parameters
flags: Flag  The flags that determine the behavior of this attribute.

Properties

Flags : Flag
[Get]
These flags determine the behavior of the Optional tag in the editor.
Signature
Flag Oculus.Interaction.OptionalAttribute.Flags

Inner Enum

Flag Enum

Flags that determine the visibility of the Optional tag in the editor.

Enumeration Constants

MemberValueDescription
None
0
Presents the Optional tag and moves it into the Optional Section
AutoGenerated
1 << 0
Indicates that if the reference is missing, a new object will be created and linked to it during runtime.
DontHide
1 << 1
Indicates that even though the reference is Optional, it is important for the component to work as expected.
Obsolete
1 << 2
Indicates that the field is obsolete and should be avoided