Skip to content

Commit afe92ad

Browse files
committed
Possibility to set default properties in Toolbox Settings
1 parent e661ef5 commit afe92ad

2 files changed

Lines changed: 36 additions & 7 deletions

File tree

Assets/Editor Toolbox/Editor/ToolboxEditorSettings.cs

Lines changed: 36 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
namespace Toolbox.Editor
88
{
99
using Toolbox.Editor.Drawers;
10-
using Toolbox.Editor.Hierarchy;
1110
using Toolbox.Editor.Folders;
11+
using Toolbox.Editor.Hierarchy;
1212

1313
internal interface IToolboxGeneralSettings
1414
{ }
@@ -201,6 +201,37 @@ private void OnValidate()
201201

202202
#endregion
203203

204+
public void Reset()
205+
{
206+
ResetHierarchySettings();
207+
ResetProjectSettings();
208+
ResetInspectorSettings();
209+
}
210+
211+
public void ResetHierarchySettings()
212+
{
213+
UseToolboxHierarchy = true;
214+
RowDataTypes = Defaults.rowDataTypes;
215+
DrawHorizontalLines = true;
216+
ShowSelectionsCount = true;
217+
}
218+
219+
public void ResetProjectSettings()
220+
{
221+
UseToolboxProject = true;
222+
ResetIconRectProperties();
223+
CustomFolders = new List<FolderData>();
224+
}
225+
226+
public void ResetInspectorSettings()
227+
{
228+
UseToolboxDrawers = true;
229+
SetAllPossibleDecoratorDrawers();
230+
SetAllPossibleConditionDrawers();
231+
SetAllPossibleSelfPropertyDrawers();
232+
SetAllPossibleListPropertyDrawers();
233+
SetAllPossibleTargetTypeDrawers();
234+
}
204235

205236
public void SetAllPossibleDecoratorDrawers()
206237
{
@@ -252,7 +283,6 @@ public void SetAllPossibleTargetTypeDrawers()
252283
}
253284
}
254285

255-
256286
public void ResetIconRectProperties()
257287
{
258288
largeIconScale = Defaults.largeFolderIconScaleDefault;
@@ -331,10 +361,10 @@ public bool UseToolboxDrawers
331361
set => useToolboxDrawers = value;
332362
}
333363

334-
public bool ForceDefaultLists
335-
{
336-
get => forceDefaultLists;
337-
set => forceDefaultLists = value;
364+
public bool ForceDefaultLists
365+
{
366+
get => forceDefaultLists;
367+
set => forceDefaultLists = value;
338368
}
339369

340370
public List<SerializedType> DecoratorDrawerHandlers

Assets/Editor Toolbox/Editor/ToolboxManager.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ namespace Toolbox.Editor
66
{
77
using Editor = UnityEditor.Editor;
88

9-
[InitializeOnLoad]
109
internal static class ToolboxManager
1110
{
1211
private const string settingsType = nameof(ToolboxEditorSettings);

0 commit comments

Comments
 (0)