Abstract Public SelfCreates a new inspectable field UI for the specified property.
Context shared by all inspectable fields created by the same parent.
Name of the property, or some other value to set as the title.
Full path to this property (includes name of this property and all parent properties).
Type of property this field will be used for displaying.
Determines how deep within the inspector nesting hierarchy is this field. Some fields may contain other fields, in which case you should increase this value by one.
Parent layout that all the field elements will be added to.
Serializable property referencing the array whose contents to display.
Protected_Protected Readonly_Protected Readonly_Protected_Protected Readonly_Protected Readonly_Protected_Protected Readonly_Protected Readonly_Protected_Protected Readonly_Protected Readonly_Finishes recording an undo command started via startUndoForPath. If any changes are detected on the field an undo command is recorded onto the undo-redo stack, otherwise nothing is done.
Zero parameter wrapper for startUndoForPath
Notifies the system to start recording a new undo command. Any changes to the field after this is called
will be recorded in the command. User must call endUndo after field is done being changed.
OptionalsubPath: string
Optional path to append to the end of the current field path.
Gets the InspectorFieldContainer that owns this field.
Information that can be used for customizing field rendering and behaviour.
Gets the depth of the field.
Gets the layout of the field.
Activates or deactivates the underlying UI elements.
Disables or enables the underlying UI elements. Disabled elements cannot be interacted with and have a faded out appearance.
Determines if the field is in focused state.
Disables or enables the underlying UI elements. Disabled elements cannot be interacted with and have a faded out appearance.
Name portion of the field path.
Returns the path to the field.
Property this field is displaying contents of.
Virtual
Destroys all UI elements in the inspectable field.
Searches for a child field with the specified path. The path must start with the field that this method is invoked on.
Path relative to the current field. Path entries are field names separated with /.
Fields within categories are placed within a special category group, surrounded by [].
Examples:
- myField
- myObject/myField
- myObject/[myCategory]/myField
Matching field if one is found, null otherwise.
Virtual
Searches for a child field with the specified path. The path must start with the field that this method is invoked on.
Path relative to the current field. This should be an array of path elements.
Fields within categories are placed within a special category group, surrounded by [].
Examples:
- ["myField"]
- ["myObject", "myField"]
- ["myObject", "[myCategory]", "myField"]
Optionalchildren: InspectorFieldBase[]
The children of this field.
Matching field if one is found, null otherwise.
Virtual
Searches and focuses a child field with the specified path. The path must start with the field that this method is invoked on.
Path relative to the current field. This should be an array of path elements.
Fields within categories are placed within a special category group, surrounded by [].
Examples:
- ["myField"]
- ["myObject", "myField"]
- ["myObject", "[myCategory]", "myField"]
True if a field was focused, false otherwise.
AbstractinitializeVirtual
Initializes the UI elements for the field.
Virtual
Checks whether the field can focus the given sub field.
The name of the sub field to focus. This is a path containing the field name and sub field name.
True, if focusing is possible.
Virtual
Notifies the owning inspector that it needs to be refreshed on the next update loop.
ProtectedonCalled when this field or a child of this field is focused. Use this to e.g. expand a field foldout to make the child visible.
Virtual
Checks if contents of the field have been modified, and updates them if needed.
Optionalflags: EnumValue<InspectableRefreshFlag>
Flags that determine the refresh behavior that the field should have.
State representing was anything modified between two last calls to refresh.
Searches the inspector field hierarchy for fields that are an instance of at least one of the provided types.
A list of all fields that match one of the types.
Virtual
Activates or deactivates the underlying UI elements.
Virtual
Disables or enables the underlying UI elements. Disabled elements cannot be interacted with and have a faded out appearance.
Virtual
Moves keyboard focus to this field.
OptionalsubFieldName: string
Name of the sub-field to focus on. Only relevant if the inspectable field represents multiple UI input elements.
Virtual
Set the element read only.
The new read only value
Assigns the field value to the underlying property and creates an undo operation.
StaticcreateCreates a new inspectable field, automatically detecting the most appropriate implementation for the type
contained in the provided serializable property. This may be one of the built-in inspectable field implemetations
(like ones for primitives like int or bool), or a user defined implementation defined with a
CustomInspectorAttribute attribute.
Context shared by all inspectable fields created by the same parent.
Name of the property, or some other value to set as the title.
Full path to this property (includes name of this property and all parent properties).
Index into the parent layout at which to insert the UI elements for the field .
Determines how deep within the inspector nesting hierarchy is this field. Some fields may contain other fields, in which case you should increase this value by one.
Parent layout that all the field elements will be added to.
Serializable property referencing the array whose contents to display.
Optionalparent: InspectorFieldContainerOptionalfnGetParentFieldConditionals: () => InspectorFieldConditionalInfo[]Inspectable field that can be used for displaying the UI for an InspectableProperty of the provided type.
StaticgetReturns the top-most part of the provided field path.
See findPath2 for more information about paths.
Path to return the sub-path of.
Number of path elements to retrieve.
First count elements of the path.
StaticupdateA helper function that takes a state by reference. If the state has
InspectableState.Modified set, the state is set to InspectableState.NotModified.
Returns an object of the oldState (before modifying it) and the newState that should
be set on the field.
This method should usually be used as such:
The current state of the field.
An object of the old state of the field and the new state that it should be set to.
The InspectorFieldBase displays UI elements for a single InspectableProperty. This is a base class that should be specialized for all supported types contained by InspectableProperty. Inspectable fields can and should be created recursively - normally complex types like objects and arrays will contain fields of their own, while primitive types like integer or boolean will consist of only a UI element.