No type in ObjectField created in uxml (UIElements)

When i create an ObjectField inside the uxml file it appears in the inspector with no type.

uxml:

<uie:ObjectField name="Texture2D" binding-path="icone" label="Object" allow-scene-objects="false"/>

137022-anotacao-2019-04-25-002518.png

What I did to work around this problem is to change the type via code:

 root.Query<ObjectField>("Texture2D").ForEach((obj) => {
            obj.objectType = typeof(Texture2D);
        });

137024-anotacao-2019-04-25-004303.png

In the documentation does not have any use example .

How can i add the type in a ObjectField by uxml?

Just use full assembly name.

 <uie:ObjectField name="Texture2D" type="UnityEngine.Texture2D, UnityEngine.CoreModule" binding-path="icone" label="Object" allow-scene-objects="false"/>

You can’t. You need to poke it through C#. Such as follows:

var uxmlField = container.Q<ObjectField>("the-uxml-field");
uxmlField.type = typeof(YourType);

Seems like the field has been changed from type to objectType.

Type处填写UnityEngine.Texture2D,他会自动补全为UnityEngine.Texture2D, UnityEngine.CoreModule