com.wallstop-studios.unity-helpers 2.0.0-rc73.8 → 2.0.0-rc74.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/Editor/AnimationEventEditor.cs +4 -5
  2. package/Editor/CustomEditors/MatchColliderToSpriteEditor.cs +1 -1
  3. package/Editor/CustomEditors/PersistentDirectoryGUI.cs +796 -0
  4. package/Editor/CustomEditors/PersistentDirectoryGUI.cs.meta +3 -0
  5. package/Editor/CustomEditors/SourceFolderEntryDrawer.cs +275 -0
  6. package/Editor/CustomEditors/SourceFolderEntryDrawer.cs.meta +3 -0
  7. package/Editor/FitTextureSizeWindow.cs +5 -44
  8. package/Editor/PersistentDirectorySettings.cs +248 -0
  9. package/Editor/PersistentDirectorySettings.cs.meta +3 -0
  10. package/Editor/PrefabChecker.cs +1 -2
  11. package/Editor/{AnimationCopier.cs → Sprites/AnimationCopier.cs} +33 -166
  12. package/Editor/{AnimationCreator.cs → Sprites/AnimationCreator.cs} +16 -80
  13. package/Editor/Sprites/ScriptableSpriteAtlas.cs +95 -0
  14. package/Editor/Sprites/ScriptableSpriteAtlas.cs.meta +3 -0
  15. package/Editor/Sprites/ScriptableSpriteAtlasEditor.cs +930 -0
  16. package/Editor/Sprites/ScriptableSpriteAtlasEditor.cs.meta +3 -0
  17. package/Editor/{SpriteCropper.cs → Sprites/SpriteCropper.cs} +80 -77
  18. package/Editor/{SpriteSettingsApplier.cs → Sprites/SpriteSettingsApplier.cs} +9 -76
  19. package/Editor/{TextureResizerWizard.cs → Sprites/TextureResizerWizard.cs} +1 -1
  20. package/Editor/{TextureSettingsApplier.cs → Sprites/TextureSettingsApplier.cs} +1 -1
  21. package/Editor/Sprites.meta +3 -0
  22. package/Editor/Utils/DxReadOnlyPropertyDrawer.cs +1 -1
  23. package/Runtime/Core/Helper/DirectoryHelper.cs +64 -0
  24. package/Runtime/Core/Helper/Partials/ObjectHelpers.cs +3 -2
  25. package/Runtime/UI/LayeredImage.cs +10 -8
  26. package/package.json +13 -1
  27. package/Editor/SpriteAtlasGenerator.cs +0 -895
  28. package/Editor/SpriteAtlasGenerator.cs.meta +0 -3
  29. package/Editor/Utils/GUIHorizontalScope.cs +0 -20
  30. package/Editor/Utils/GUIHorizontalScope.cs.meta +0 -3
  31. package/Editor/Utils/GUIIndentScope.cs +0 -20
  32. package/Editor/Utils/GUIIndentScope.cs.meta +0 -3
  33. /package/Editor/{AnimationCopier.cs.meta → Sprites/AnimationCopier.cs.meta} +0 -0
  34. /package/Editor/{AnimationCreator.cs.meta → Sprites/AnimationCreator.cs.meta} +0 -0
  35. /package/Editor/{SpriteCropper.cs.meta → Sprites/SpriteCropper.cs.meta} +0 -0
  36. /package/Editor/{SpriteSettingsApplier.cs.meta → Sprites/SpriteSettingsApplier.cs.meta} +0 -0
  37. /package/Editor/{TextureResizerWizard.cs.meta → Sprites/TextureResizerWizard.cs.meta} +0 -0
  38. /package/Editor/{TextureSettingsApplier.cs.meta → Sprites/TextureSettingsApplier.cs.meta} +0 -0
@@ -0,0 +1,3 @@
1
+ fileFormatVersion: 2
2
+ guid: a69ae57f9bf6403dbed0cc02c1f164b4
3
+ timeCreated: 1746915833
@@ -0,0 +1,275 @@
1
+ namespace WallstopStudios.UnityHelpers.Editor.CustomEditors
2
+ {
3
+ #if UNITY_EDITOR
4
+ using System;
5
+ using Sprites;
6
+ using UnityEngine;
7
+ using UnityEditor;
8
+ using System.Collections.Generic;
9
+ using Core.Helper;
10
+
11
+ [CustomPropertyDrawer(typeof(SourceFolderEntry))]
12
+ public sealed class SourceFolderEntryDrawer : PropertyDrawer
13
+ {
14
+ private const string HistoryToolName = nameof(SourceFolderEntryDrawer);
15
+ private static readonly Dictionary<string, bool> RegexesFoldoutState = new(
16
+ StringComparer.Ordinal
17
+ );
18
+
19
+ public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
20
+ {
21
+ EditorGUI.BeginProperty(position, label, property);
22
+ Rect foldoutRect = new(
23
+ position.x,
24
+ position.y,
25
+ position.width,
26
+ EditorGUIUtility.singleLineHeight
27
+ );
28
+ property.isExpanded = EditorGUI.Foldout(foldoutRect, property.isExpanded, label, true);
29
+ if (property.isExpanded)
30
+ {
31
+ int originalIndent = EditorGUI.indentLevel;
32
+ EditorGUI.indentLevel++;
33
+ float currentY = foldoutRect.yMax + EditorGUIUtility.standardVerticalSpacing;
34
+ float indentOffset = EditorGUI.indentLevel * 15f;
35
+ float startX = position.x + indentOffset;
36
+ float availableWidth = position.width - indentOffset;
37
+
38
+ SerializedProperty folderPathProp = property.FindPropertyRelative(
39
+ nameof(SourceFolderEntry.folderPath)
40
+ );
41
+ SerializedProperty regexesProp = property.FindPropertyRelative(
42
+ nameof(SourceFolderEntry.regexes)
43
+ );
44
+
45
+ Rect folderPathLabelRect = new(
46
+ startX,
47
+ currentY,
48
+ availableWidth,
49
+ EditorGUIUtility.singleLineHeight
50
+ );
51
+ EditorGUI.LabelField(folderPathLabelRect, "Folder Path", EditorStyles.boldLabel);
52
+ currentY += folderPathLabelRect.height + EditorGUIUtility.standardVerticalSpacing;
53
+
54
+ Rect pathFieldRect = new(
55
+ startX,
56
+ currentY,
57
+ availableWidth - 75,
58
+ EditorGUIUtility.singleLineHeight
59
+ );
60
+ Rect browseButtonRect = new(
61
+ pathFieldRect.xMax + 5,
62
+ currentY,
63
+ 70,
64
+ EditorGUIUtility.singleLineHeight
65
+ );
66
+
67
+ EditorGUI.BeginChangeCheck();
68
+ string newPath = EditorGUI.TextField(
69
+ pathFieldRect,
70
+ new GUIContent("Path:"),
71
+ folderPathProp.stringValue
72
+ );
73
+ if (EditorGUI.EndChangeCheck())
74
+ {
75
+ folderPathProp.stringValue = newPath;
76
+ }
77
+
78
+ if (GUI.Button(browseButtonRect, "Browse..."))
79
+ {
80
+ string initialBrowsePath = Application.dataPath; /* ... */
81
+ string selectedPathSys = EditorUtility.OpenFolderPanel(
82
+ "Select Source Folder",
83
+ initialBrowsePath,
84
+ ""
85
+ );
86
+ if (!string.IsNullOrEmpty(selectedPathSys))
87
+ {
88
+ string processedPath = selectedPathSys.SanitizePath();
89
+ if (processedPath.StartsWith(Application.dataPath.SanitizePath()))
90
+ {
91
+ processedPath =
92
+ "Assets"
93
+ + processedPath.Substring(
94
+ Application.dataPath.SanitizePath().Length
95
+ );
96
+ }
97
+ folderPathProp.stringValue = processedPath;
98
+ string contextKey = GetFolderPathFoldoutKey(folderPathProp);
99
+ PersistentDirectorySettings.Instance.RecordPath(
100
+ HistoryToolName,
101
+ contextKey,
102
+ processedPath
103
+ );
104
+ property.serializedObject.ApplyModifiedProperties();
105
+ GUI.FocusControl(null);
106
+ }
107
+ }
108
+ currentY += pathFieldRect.height + EditorGUIUtility.standardVerticalSpacing;
109
+ string historyContextKey = GetFolderPathFoldoutKey(folderPathProp);
110
+
111
+ Rect historyParentRect = new(
112
+ startX,
113
+ currentY,
114
+ availableWidth,
115
+ position.yMax - currentY
116
+ );
117
+
118
+ PersistentDirectoryGUI.DrawFrequentPathsWithEditorGUI(
119
+ historyParentRect,
120
+ ref currentY,
121
+ HistoryToolName,
122
+ historyContextKey,
123
+ chosenPath =>
124
+ {
125
+ folderPathProp.stringValue = chosenPath;
126
+ PersistentDirectorySettings.Instance.RecordPath(
127
+ HistoryToolName,
128
+ historyContextKey,
129
+ chosenPath
130
+ );
131
+ property.serializedObject.ApplyModifiedProperties();
132
+ GUI.FocusControl(null);
133
+ }
134
+ );
135
+
136
+ currentY += EditorGUIUtility.standardVerticalSpacing;
137
+ Rect regexFoldoutLabelRect = new(
138
+ startX,
139
+ currentY,
140
+ availableWidth,
141
+ EditorGUIUtility.singleLineHeight
142
+ );
143
+
144
+ string regexesFoldoutKey = GetRegexFoldoutKey(property);
145
+ RegexesFoldoutState.TryAdd(regexesFoldoutKey, true);
146
+ RegexesFoldoutState[regexesFoldoutKey] = EditorGUI.Foldout(
147
+ regexFoldoutLabelRect,
148
+ RegexesFoldoutState[regexesFoldoutKey],
149
+ "Regexes (AND logic)",
150
+ true
151
+ );
152
+ currentY += regexFoldoutLabelRect.height + EditorGUIUtility.standardVerticalSpacing;
153
+
154
+ if (RegexesFoldoutState[regexesFoldoutKey])
155
+ {
156
+ int listElementIndentLvl = EditorGUI.indentLevel;
157
+ EditorGUI.indentLevel++;
158
+ float regexStartX = startX + 15f;
159
+ float regexAvailableWidth = availableWidth - 15f;
160
+ Rect sizeFieldRect = new(
161
+ regexStartX,
162
+ currentY,
163
+ regexAvailableWidth,
164
+ EditorGUIUtility.singleLineHeight
165
+ );
166
+
167
+ EditorGUI.BeginChangeCheck();
168
+ int newSize = EditorGUI.IntField(sizeFieldRect, "Size", regexesProp.arraySize);
169
+ if (EditorGUI.EndChangeCheck())
170
+ {
171
+ newSize = Mathf.Max(0, newSize);
172
+ regexesProp.arraySize = newSize;
173
+ }
174
+ currentY += sizeFieldRect.height + EditorGUIUtility.standardVerticalSpacing;
175
+
176
+ for (int i = 0; i < regexesProp.arraySize; i++)
177
+ {
178
+ SerializedProperty elementProp = regexesProp.GetArrayElementAtIndex(i);
179
+ Rect elementRect = new(
180
+ regexStartX,
181
+ currentY,
182
+ regexAvailableWidth,
183
+ EditorGUIUtility.singleLineHeight
184
+ );
185
+ EditorGUI.BeginChangeCheck();
186
+ string newStringValue = EditorGUI.TextField(
187
+ elementRect,
188
+ $"Element {i}",
189
+ elementProp.stringValue
190
+ );
191
+ if (EditorGUI.EndChangeCheck())
192
+ {
193
+ elementProp.stringValue = newStringValue;
194
+ }
195
+ currentY += elementRect.height + EditorGUIUtility.standardVerticalSpacing;
196
+ }
197
+ EditorGUI.indentLevel = listElementIndentLvl;
198
+ }
199
+ EditorGUI.indentLevel = originalIndent;
200
+ }
201
+ EditorGUI.EndProperty();
202
+ }
203
+
204
+ public override float GetPropertyHeight(SerializedProperty property, GUIContent label)
205
+ {
206
+ float height = EditorGUIUtility.singleLineHeight;
207
+ if (!property.isExpanded)
208
+ {
209
+ return height;
210
+ }
211
+
212
+ height += EditorGUIUtility.standardVerticalSpacing;
213
+ height += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
214
+ height += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
215
+ SerializedProperty folderPathProp = property.FindPropertyRelative(
216
+ nameof(SourceFolderEntry.folderPath)
217
+ );
218
+
219
+ string historyContextKey = GetFolderPathFoldoutKey(folderPathProp);
220
+
221
+ height += PersistentDirectoryGUI.GetDrawFrequentPathsHeightEditorGUI(
222
+ HistoryToolName,
223
+ historyContextKey
224
+ );
225
+
226
+ height += EditorGUIUtility.standardVerticalSpacing;
227
+ height += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
228
+ string regexesFoldoutKey = GetRegexFoldoutKey(property);
229
+ bool isRegexesExpanded = RegexesFoldoutState.GetValueOrDefault(regexesFoldoutKey, true);
230
+ if (isRegexesExpanded)
231
+ {
232
+ SerializedProperty regexesProp = property.FindPropertyRelative(
233
+ nameof(SourceFolderEntry.regexes)
234
+ );
235
+ height +=
236
+ (1 + regexesProp.arraySize)
237
+ * (
238
+ EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing
239
+ );
240
+ }
241
+ height += EditorGUIUtility.standardVerticalSpacing;
242
+ return height;
243
+ }
244
+
245
+ private static string GetHistoryContextKey(SerializedProperty property)
246
+ {
247
+ return (
248
+ property.serializedObject.targetObject != null
249
+ ? property.serializedObject.targetObject.name
250
+ : "NULL"
251
+ ) + ".DefaultHistoryContext";
252
+ }
253
+
254
+ private static string GetFolderPathFoldoutKey(SerializedProperty property)
255
+ {
256
+ return (
257
+ property.serializedObject.targetObject != null
258
+ ? property.serializedObject.targetObject.name
259
+ : "NULL"
260
+ ) + ".folderList";
261
+ }
262
+
263
+ private static string GetRegexFoldoutKey(SerializedProperty property)
264
+ {
265
+ return (
266
+ property.serializedObject.targetObject != null
267
+ ? property.serializedObject.targetObject.name
268
+ : "NULL"
269
+ )
270
+ + property.propertyPath
271
+ + ".regexesList";
272
+ }
273
+ }
274
+ #endif
275
+ }
@@ -0,0 +1,3 @@
1
+ fileFormatVersion: 2
2
+ guid: 30a7a4de43c24796aaabe10a9929fcdf
3
+ timeCreated: 1746913161
@@ -7,6 +7,7 @@
7
7
  using UnityEditor;
8
8
  using UnityEngine;
9
9
  using Core.Extension;
10
+ using CustomEditors;
10
11
  using Object = UnityEngine.Object;
11
12
 
12
13
  public enum FitMode
@@ -65,50 +66,10 @@
65
66
  _fitMode = (FitMode)EditorGUILayout.EnumPopup("Fit Mode", _fitMode);
66
67
 
67
68
  EditorGUILayout.Space();
68
- EditorGUILayout.LabelField("Source Folders", EditorStyles.boldLabel);
69
-
70
- if (GUILayout.Button("Add Source Directory"))
71
- {
72
- string path = EditorUtility.OpenFolderPanel(
73
- "Select Texture Source Directory",
74
- "Assets",
75
- ""
76
- );
77
- if (!string.IsNullOrWhiteSpace(path))
78
- {
79
- if (path.StartsWith(Application.dataPath))
80
- {
81
- string relativePath =
82
- "Assets" + path.Substring(Application.dataPath.Length);
83
- Object folderObject = AssetDatabase.LoadAssetAtPath<Object>(relativePath);
84
- if (folderObject != null)
85
- {
86
- _textureSourcePaths ??= new List<Object>();
87
- if (!_textureSourcePaths.Contains(folderObject))
88
- {
89
- _textureSourcePaths.Add(folderObject);
90
- _potentialChangeCount = -1;
91
- }
92
- else
93
- {
94
- this.LogWarn($"Directory '{relativePath}' is already in the list.");
95
- }
96
- }
97
- else
98
- {
99
- this.LogError($"Could not load asset at path: '{relativePath}'");
100
- }
101
- }
102
- else
103
- {
104
- this.LogError(
105
- $"Selected path is outside the project's Assets folder: '{path}'"
106
- );
107
- }
108
- }
109
- }
110
-
111
- EditorGUILayout.PropertyField(_textureSourcePathsProperty, true);
69
+ PersistentDirectoryGUI.PathSelectorObjectArray(
70
+ _textureSourcePathsProperty,
71
+ nameof(FitTextureSizeWindow)
72
+ );
112
73
  EditorGUILayout.Space();
113
74
  EditorGUILayout.LabelField("Actions", EditorStyles.boldLabel);
114
75
 
@@ -0,0 +1,248 @@
1
+ namespace WallstopStudios.UnityHelpers.Editor
2
+ {
3
+ #if UNITY_EDITOR
4
+ using System;
5
+ using UnityEngine;
6
+ using UnityEditor;
7
+ using System.Collections.Generic;
8
+ using System.Linq;
9
+ using System.IO;
10
+ using Core.Helper;
11
+ using UnityEngine.Serialization;
12
+
13
+ [Serializable]
14
+ public sealed class DirectoryUsageData
15
+ {
16
+ public string path;
17
+ public int count;
18
+ public long lastUsedTicks;
19
+
20
+ public DirectoryUsageData(string p)
21
+ {
22
+ path = p;
23
+ count = 0;
24
+ lastUsedTicks = DateTime.UtcNow.Ticks;
25
+ }
26
+
27
+ public void MarkUsed()
28
+ {
29
+ count++;
30
+ lastUsedTicks = DateTime.UtcNow.Ticks;
31
+ }
32
+ }
33
+
34
+ [Serializable]
35
+ public sealed class ContextHistory
36
+ {
37
+ public string contextKey;
38
+ public List<DirectoryUsageData> directories = new();
39
+
40
+ public ContextHistory() { }
41
+
42
+ public ContextHistory(string key)
43
+ {
44
+ contextKey = key;
45
+ }
46
+
47
+ public DirectoryUsageData GetOrAddDirectory(string path)
48
+ {
49
+ DirectoryUsageData dirData = directories.Find(directoryData =>
50
+ string.Equals(directoryData.path, path, StringComparison.Ordinal)
51
+ );
52
+ if (dirData != null)
53
+ {
54
+ return dirData;
55
+ }
56
+
57
+ dirData = new DirectoryUsageData(path);
58
+ directories.Add(dirData);
59
+ return dirData;
60
+ }
61
+ }
62
+
63
+ [Serializable]
64
+ public sealed class ToolHistory
65
+ {
66
+ public string toolName;
67
+ public List<ContextHistory> contexts = new();
68
+
69
+ public ToolHistory() { }
70
+
71
+ public ToolHistory(string name)
72
+ {
73
+ toolName = name;
74
+ }
75
+
76
+ public ContextHistory GetOrAddContext(string contextKey)
77
+ {
78
+ ContextHistory context = contexts.Find(c =>
79
+ string.Equals(c.contextKey, contextKey, StringComparison.Ordinal)
80
+ );
81
+ if (context != null)
82
+ {
83
+ return context;
84
+ }
85
+
86
+ context = new ContextHistory(contextKey);
87
+ contexts.Add(context);
88
+ return context;
89
+ }
90
+ }
91
+
92
+ public sealed class PersistentDirectorySettings : ScriptableObject
93
+ {
94
+ private const string DefaultAssetPath = "Assets/Editor/PersistentDirectorySettings.asset";
95
+
96
+ [FormerlySerializedAs("allToolHistories")]
97
+ [SerializeField]
98
+ private List<ToolHistory> _allToolHistories = new();
99
+
100
+ private static PersistentDirectorySettings _instance;
101
+
102
+ public static PersistentDirectorySettings Instance
103
+ {
104
+ get
105
+ {
106
+ if (_instance == null)
107
+ {
108
+ PersistentDirectorySettings[] settings = AssetDatabase
109
+ .FindAssets($"t:{nameof(PersistentDirectorySettings)}")
110
+ .Select(AssetDatabase.GUIDToAssetPath)
111
+ .Select(AssetDatabase.LoadAssetAtPath<PersistentDirectorySettings>)
112
+ .Where(Objects.NotNull)
113
+ .ToArray();
114
+
115
+ if (settings.Length > 0)
116
+ {
117
+ if (settings.Length > 1)
118
+ {
119
+ Debug.LogWarning(
120
+ $"Multiple instances of {nameof(PersistentDirectorySettings)} found. Using the first one at: {AssetDatabase.GetAssetPath(settings[0])}. Please ensure only one instance exists for consistent behavior."
121
+ );
122
+ }
123
+
124
+ _instance = settings[0];
125
+ }
126
+ else
127
+ {
128
+ if (_instance == null)
129
+ {
130
+ Debug.Log(
131
+ $"No instance of {nameof(PersistentDirectorySettings)} found. Creating a new one at {DefaultAssetPath}."
132
+ );
133
+ _instance = CreateInstance<PersistentDirectorySettings>();
134
+
135
+ string directoryPath = Path.GetDirectoryName(DefaultAssetPath);
136
+ if (
137
+ !string.IsNullOrWhiteSpace(directoryPath)
138
+ && !Directory.Exists(directoryPath)
139
+ )
140
+ {
141
+ Directory.CreateDirectory(directoryPath);
142
+ }
143
+
144
+ AssetDatabase.CreateAsset(_instance, DefaultAssetPath);
145
+ AssetDatabase.SaveAssets();
146
+ AssetDatabase.Refresh();
147
+ EditorUtility.FocusProjectWindow();
148
+ Selection.activeObject = _instance;
149
+ }
150
+ }
151
+ }
152
+
153
+ if (_instance == null)
154
+ {
155
+ Debug.LogError(
156
+ $"Failed to find or create {nameof(PersistentDirectorySettings)}. Directory persistence will not work."
157
+ );
158
+ }
159
+
160
+ return _instance;
161
+ }
162
+ }
163
+
164
+ private ToolHistory GetOrAddToolHistory(string toolName)
165
+ {
166
+ ToolHistory toolHistory = _allToolHistories.Find(toolHistory =>
167
+ string.Equals(toolHistory.toolName, toolName, StringComparison.Ordinal)
168
+ );
169
+ if (toolHistory != null)
170
+ {
171
+ return toolHistory;
172
+ }
173
+
174
+ toolHistory = new ToolHistory(toolName);
175
+ _allToolHistories.Add(toolHistory);
176
+
177
+ return toolHistory;
178
+ }
179
+
180
+ public void RecordPath(string toolName, string contextKey, string path)
181
+ {
182
+ if (
183
+ string.IsNullOrWhiteSpace(toolName)
184
+ || string.IsNullOrWhiteSpace(contextKey)
185
+ || string.IsNullOrWhiteSpace(path)
186
+ )
187
+ {
188
+ Debug.LogWarning("RecordPath: toolName, contextKey, or path cannot be empty.");
189
+ return;
190
+ }
191
+
192
+ string sanitizedPath = path.SanitizePath();
193
+ if (
194
+ !sanitizedPath.StartsWith("Assets/", StringComparison.Ordinal)
195
+ || !AssetDatabase.IsValidFolder(sanitizedPath)
196
+ )
197
+ {
198
+ if (
199
+ !Path.IsPathRooted(sanitizedPath)
200
+ && !sanitizedPath.StartsWith("Assets/", StringComparison.Ordinal)
201
+ )
202
+ {
203
+ Debug.LogWarning(
204
+ $"Recording path '{sanitizedPath}' that is not an 'Assets/' relative path or an absolute path. This might be intentional."
205
+ );
206
+ }
207
+ }
208
+
209
+ ToolHistory tool = GetOrAddToolHistory(toolName);
210
+ ContextHistory context = tool.GetOrAddContext(contextKey);
211
+ DirectoryUsageData dirData = context.GetOrAddDirectory(sanitizedPath);
212
+ dirData.MarkUsed();
213
+ EditorUtility.SetDirty(this);
214
+ }
215
+
216
+ public DirectoryUsageData[] GetPaths(
217
+ string toolName,
218
+ string contextKey,
219
+ bool topOnly = false,
220
+ int topN = 5
221
+ )
222
+ {
223
+ ToolHistory tool = _allToolHistories.Find(th =>
224
+ string.Equals(th.toolName, toolName, StringComparison.Ordinal)
225
+ );
226
+ if (tool == null)
227
+ {
228
+ return Array.Empty<DirectoryUsageData>();
229
+ }
230
+
231
+ ContextHistory context = tool.contexts.Find(c =>
232
+ string.Equals(c.contextKey, contextKey, StringComparison.Ordinal)
233
+ );
234
+ if (context == null)
235
+ {
236
+ return Array.Empty<DirectoryUsageData>();
237
+ }
238
+
239
+ DirectoryUsageData[] sortedDirectories = context
240
+ .directories.OrderByDescending(directoryData => directoryData.count)
241
+ .ThenByDescending(directoryData => directoryData.lastUsedTicks)
242
+ .ToArray();
243
+
244
+ return topOnly ? sortedDirectories.Take(topN).ToArray() : sortedDirectories;
245
+ }
246
+ }
247
+ #endif
248
+ }
@@ -0,0 +1,3 @@
1
+ fileFormatVersion: 2
2
+ guid: c86a641278ae47599e2061241a0a74f6
3
+ timeCreated: 1746915782
@@ -12,7 +12,6 @@
12
12
  using Core.Attributes;
13
13
  using Core.Extension;
14
14
  using Core.Helper;
15
- using Utils;
16
15
  using WallstopStudios.UnityHelpers.Utils;
17
16
  using Object = UnityEngine.Object;
18
17
 
@@ -149,7 +148,7 @@
149
148
  GUI.enabled = wasEnabled && _checkNullObjectReferences;
150
149
  try
151
150
  {
152
- using GUIIndentScope indent = new();
151
+ using EditorGUI.IndentLevelScope indent = new();
153
152
  DrawAndAlign(
154
153
  new GUIContent(
155
154
  "Only if [ValidateAssignment]",