# DataObject Property Drawer

The DataObject dropdown property drawer is a very powerful UI element which draws your DataObjects fields and custom editor inside of your custom classes. To make use of the property drawer simply add the **DataObjectDropdown** attribute to your DataObject field. A required string must be provided to the attribute which is the name of the DataLibrary reference field. \
See following example:

```csharp
// All Databrain attributes are in this namespace
using Databrain.Attributes;

// Data Library reference
public DataLibrary data;

[DataObjectDropdown(nameof(data))]
public DataObject myDataObject;
```

The property drawer can display custom editors like the Logic - node editor, default fields and also custom Odin Inspector editors. (Since version 1.3)

<div data-full-width="false"><figure><img src="/files/RvQjCLpQACwvM09rmPBG" alt=""><figcaption></figcaption></figure></div>

Using the Runtime switch, switches from initial to the runtime data object. (If there's any runtime DataObject available)

<div align="left"><figure><img src="/files/cJOkVQ8hL9nezt90snsW" alt=""><figcaption></figcaption></figure></div>

## Interface

<figure><img src="/files/E14GezMpjAl6go94NkgR" alt=""><figcaption></figcaption></figure>

1. Add DataObjectDropdown attribute to a DataObject field and provide the name of the DataLibrary field.
2. Select and assign the DataObject from the dropdown.
3. Un-assign the DataObject reference.
4. Create a new DataObject.
5. Inspector popup. Show DataObject fields which have the ExposeToInspector-attribute. You can modify those values directly from the Unity inspector.
6. View selected DataObject in the Databrain editor. (opens Databrain editor)
7. ExposeToInspector popup view. (Shows only fields which are marked with the ExposeToInspector attribute)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://giantgrey.gitbook.io/databrain/dataobject-property-drawer.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
