mirror of
https://github.com/codewriter-packages/Tri-Inspector.git
synced 2025-01-22 08:18:49 -05:00
Now UIToolkit support is opt-in
This commit is contained in:
parent
cd828c6017
commit
6bbde41299
@ -25,15 +25,19 @@ namespace TriInspector.Drawers
|
||||
|
||||
if (drawWithHandler)
|
||||
{
|
||||
handler.SetPreferredLabel(property.DisplayName);
|
||||
|
||||
var visualElement = handler.CreatePropertyGUI(serializedProperty);
|
||||
|
||||
if (visualElement != null &&
|
||||
TriEditorCore.UiElementsRoots.TryGetValue(property.PropertyTree, out var rootElement))
|
||||
if (property.TryGetAttribute(out DrawWithUnityAttribute withUnityAttribute) &&
|
||||
withUnityAttribute.WithUiToolkit)
|
||||
{
|
||||
return new TriUiToolkitPropertyElement(property, serializedProperty,
|
||||
visualElement, rootElement);
|
||||
handler.SetPreferredLabel(property.DisplayName);
|
||||
|
||||
var visualElement = handler.CreatePropertyGUI(serializedProperty);
|
||||
|
||||
if (visualElement != null &&
|
||||
TriEditorCore.UiElementsRoots.TryGetValue(property.PropertyTree, out var rootElement))
|
||||
{
|
||||
return new TriUiToolkitPropertyElement(property, serializedProperty,
|
||||
visualElement, rootElement);
|
||||
}
|
||||
}
|
||||
|
||||
return new TriBuiltInPropertyElement(property, serializedProperty, handler);
|
||||
|
@ -7,5 +7,6 @@ namespace TriInspector
|
||||
[Conditional("UNITY_EDITOR")]
|
||||
public class DrawWithUnityAttribute : Attribute
|
||||
{
|
||||
public bool WithUiToolkit { get; set; }
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user