mirror of
https://github.com/codewriter-packages/Tri-Inspector.git
synced 2025-01-22 00:08:51 -05:00
Fix Inline (Material) Editor does not always display correctly
This commit is contained in:
parent
29dafd0193
commit
cc22282a08
@ -18,17 +18,6 @@ namespace TriInspector.Elements
|
||||
_editorPosition = Rect.zero;
|
||||
}
|
||||
|
||||
protected override void OnAttachToPanel()
|
||||
{
|
||||
base.OnAttachToPanel();
|
||||
|
||||
var target = _property.Value as Object;
|
||||
if (target != null && !InternalEditorUtilityProxy.GetIsInspectorExpanded(target))
|
||||
{
|
||||
InternalEditorUtilityProxy.SetIsInspectorExpanded(target, true);
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnDetachFromPanel()
|
||||
{
|
||||
if (_editor != null)
|
||||
@ -83,6 +72,11 @@ namespace TriInspector.Elements
|
||||
if (_editor == null && shouldDrawEditor && _property.Value is Object obj && obj != null)
|
||||
{
|
||||
_editor = Editor.CreateEditor(obj);
|
||||
|
||||
if (!InternalEditorUtilityProxy.GetIsInspectorExpanded(obj))
|
||||
{
|
||||
InternalEditorUtilityProxy.SetIsInspectorExpanded(obj, true);
|
||||
}
|
||||
}
|
||||
|
||||
if (_editor != null && shouldDrawEditor)
|
||||
|
Loading…
Reference in New Issue
Block a user