mirror of
https://github.com/codewriter-packages/Tri-Inspector.git
synced 2025-01-22 08:18:49 -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;
|
_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()
|
protected override void OnDetachFromPanel()
|
||||||
{
|
{
|
||||||
if (_editor != null)
|
if (_editor != null)
|
||||||
@ -83,6 +72,11 @@ namespace TriInspector.Elements
|
|||||||
if (_editor == null && shouldDrawEditor && _property.Value is Object obj && obj != null)
|
if (_editor == null && shouldDrawEditor && _property.Value is Object obj && obj != null)
|
||||||
{
|
{
|
||||||
_editor = Editor.CreateEditor(obj);
|
_editor = Editor.CreateEditor(obj);
|
||||||
|
|
||||||
|
if (!InternalEditorUtilityProxy.GetIsInspectorExpanded(obj))
|
||||||
|
{
|
||||||
|
InternalEditorUtilityProxy.SetIsInspectorExpanded(obj, true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_editor != null && shouldDrawEditor)
|
if (_editor != null && shouldDrawEditor)
|
||||||
|
Loading…
Reference in New Issue
Block a user