When using an attribute
[InlineEditor] public Material mat;
the inline editor sometimes fails to draw (empty, reported height=0) completely in case one assign a new Material to the mat variable from the Inspector.
Reason seems to be:
In InlineEditorElement.cs
When assigning a new value via the inspector the call to
InternalEditorUtilityProxy.SetIsInspectorExpanded is omitted. This call only happens when the element is attached to a panel.
See InlineEditorElement.OnAttachToPanel().
Depending on the Material's state the InlineEditor sometimes does draw. Especially if you switch to a different MonoBehaviour and back.
Possible Fix:
public override void OnGUI(Rect position)
{
...
if (_editor == null && shouldDrawEditor && _property.Value is Object obj && obj != null)
{
_editor = Editor.CreateEditor(obj);
if (obj != null && !InternalEditorUtilityProxy.GetIsInspectorExpanded(obj))
{
InternalEditorUtilityProxy.SetIsInspectorExpanded(obj, true);
}
}
...
Desktop:
Windows 10
Unity version:
2022.3.10f1
Tri Inspector version:
1.13.2
Describe the bug
When using an attribute
[InlineEditor] public Material mat;
the inline editor sometimes fails to draw (empty, reported height=0) completely in case one assign a new Material to the mat variable from the Inspector.Reason seems to be: In InlineEditorElement.cs When assigning a new value via the inspector the call to
InternalEditorUtilityProxy.SetIsInspectorExpanded
is omitted. This call only happens when the element is attached to a panel. See InlineEditorElement.OnAttachToPanel(). Depending on the Material's state the InlineEditor sometimes does draw. Especially if you switch to a different MonoBehaviour and back.Possible Fix:
Desktop: Windows 10 Unity version: 2022.3.10f1 Tri Inspector version: 1.13.2