Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions Editor.Extras/Drawers/CustomBuiltInDrawer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,19 @@ public override TriElement CreateElement(TriValue<object> propertyValue, TriElem

if (drawWithHandler)
{
handler.SetPreferredLabel(property.DisplayName);
if (property.TryGetAttribute(out DrawWithUnityAttribute withUnityAttribute) &&
withUnityAttribute.WithUiToolkit)
{
handler.SetPreferredLabel(property.DisplayName);

var visualElement = handler.CreatePropertyGUI(serializedProperty);
var visualElement = handler.CreatePropertyGUI(serializedProperty);

if (visualElement != null &&
TriEditorCore.UiElementsRoots.TryGetValue(property.PropertyTree, out var rootElement))
{
return new TriUiToolkitPropertyElement(property, serializedProperty,
visualElement, rootElement);
if (visualElement != null &&
TriEditorCore.UiElementsRoots.TryGetValue(property.PropertyTree, out var rootElement))
{
return new TriUiToolkitPropertyElement(property, serializedProperty,
visualElement, rootElement);
}
}

return new TriBuiltInPropertyElement(property, serializedProperty, handler);
Expand Down
1 change: 1 addition & 0 deletions Runtime/Attributes/DrawWithUnityAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ namespace TriInspector
[Conditional("UNITY_EDITOR")]
public class DrawWithUnityAttribute : Attribute
{
public bool WithUiToolkit { get; set; }
}
}