Skip to content

Commit ddac99f

Browse files
committed
Add HideScript property to the InLineEditor attribute
1 parent 6fdb939 commit ddac99f

2 files changed

Lines changed: 14 additions & 0 deletions

File tree

Assets/Editor Toolbox/Editor/Drawers/Toolbox/PropertySelf/InLineEditorAttributeDrawer.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,14 @@ static InLineEditorAttributeDrawer()
2323
editor.ReloadPreviewInstances();
2424
}
2525

26+
if (a.HideScript)
27+
{
28+
if (editor is ToolboxEditor toolboxEditor)
29+
{
30+
toolboxEditor.IgnoreProperty(PropertyUtility.Defaults.scriptPropertyName);
31+
}
32+
}
33+
2634
return editor;
2735
}
2836
else

Assets/Editor Toolbox/Runtime/Attributes/Toolbox/PropertySelfAttributes/InLineEditorAttribute.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@ public InLineEditorAttribute(bool drawHeader, bool drawPreview = true, bool draw
3333

3434
public bool DrawSettings { get; private set; }
3535

36+
/// <summary>
37+
/// Indicates if the "m_Script" property should be hidden.
38+
/// Will work only for Toolbox-based Editors.
39+
/// </summary>
40+
public bool HideScript { get; set; } = true;
41+
3642
/// <summary>
3743
/// Indicates if the inlined Editor should be disabled.
3844
/// </summary>

0 commit comments

Comments
 (0)