OptionalAttribute Class
Extends PropertyAttribute
Used on a SerializedField and surfaces the expectation that this field can remain empty.
Enumeration Flag
Flags that determine the visibility of the Optional tag in the editor.
| Presents the Optional tag and moves it into the Optional Section |
| Indicates that if the reference is missing, a new object will be created and linked to it during runtime. |
| Indicates that even though the reference is Optional, it is important for the component to work as expected. |
| Indicates that the field is obsolete and should be avoided |
These flags determine the behavior of the Optional tag in the editor.
Create a new Optional attribute with default flags.
Create a new Optional attribute with the specified flags.
ParametersflagsThe flags that determine the behavior of this attribute.