Skip to content

Commit cc22282

Browse files
committed
Fix Inline (Material) Editor does not always display correctly
1 parent 29dafd0 commit cc22282

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

Editor/Elements/InlineEditorElement.cs

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,6 @@ public InlineEditorElement(TriProperty property)
1818
_editorPosition = Rect.zero;
1919
}
2020

21-
protected override void OnAttachToPanel()
22-
{
23-
base.OnAttachToPanel();
24-
25-
var target = _property.Value as Object;
26-
if (target != null && !InternalEditorUtilityProxy.GetIsInspectorExpanded(target))
27-
{
28-
InternalEditorUtilityProxy.SetIsInspectorExpanded(target, true);
29-
}
30-
}
31-
3221
protected override void OnDetachFromPanel()
3322
{
3423
if (_editor != null)
@@ -83,6 +72,11 @@ public override void OnGUI(Rect position)
8372
if (_editor == null && shouldDrawEditor && _property.Value is Object obj && obj != null)
8473
{
8574
_editor = Editor.CreateEditor(obj);
75+
76+
if (!InternalEditorUtilityProxy.GetIsInspectorExpanded(obj))
77+
{
78+
InternalEditorUtilityProxy.SetIsInspectorExpanded(obj, true);
79+
}
8680
}
8781

8882
if (_editor != null && shouldDrawEditor)

0 commit comments

Comments
 (0)