Skip to content

Commit c227c18

Browse files
committed
Update
1 parent 16a75fe commit c227c18

File tree

5 files changed

+14
-64
lines changed

5 files changed

+14
-64
lines changed
Lines changed: 0 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using System;
2-
using UnityEditor;
32
using UnityEngine;
43

54
namespace EditorGUIUtils
@@ -57,56 +56,4 @@ public void Dispose()
5756
GUI.color = _oldColors[2];
5857
}
5958
}
60-
61-
public class HorizontalGroupScope : IDisposable
62-
{
63-
public HorizontalGroupScope(GUIStyle style, params GUILayoutOption[] options)
64-
{
65-
EditorGUILayout.BeginHorizontal(style, options);
66-
}
67-
68-
public HorizontalGroupScope(params GUILayoutOption[] options)
69-
{
70-
EditorGUILayout.BeginHorizontal(options);
71-
}
72-
73-
public void Dispose()
74-
{
75-
EditorGUILayout.EndHorizontal();
76-
}
77-
}
78-
79-
public class VerticalGroupScope : IDisposable
80-
{
81-
public VerticalGroupScope(GUIStyle style, params GUILayoutOption[] options)
82-
{
83-
EditorGUILayout.BeginVertical(style, options);
84-
}
85-
86-
public VerticalGroupScope(GUIStyle style, Color color, params GUILayoutOption[] options)
87-
{
88-
using (new ColorScope(color, ColorType.All))
89-
{
90-
EditorGUILayout.BeginVertical(style, options);
91-
}
92-
}
93-
94-
public VerticalGroupScope(params GUILayoutOption[] options)
95-
{
96-
EditorGUILayout.BeginVertical(options);
97-
}
98-
99-
public VerticalGroupScope(Color color, params GUILayoutOption[] options)
100-
{
101-
using (new ColorScope(color, ColorType.All))
102-
{
103-
EditorGUILayout.BeginVertical(options);
104-
}
105-
}
106-
107-
public void Dispose()
108-
{
109-
EditorGUILayout.EndVertical();
110-
}
111-
}
11259
}

Assets/UnityEventTracker/Scripts/Editor/Utils/Logger.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public static IEnumerable<string> GetBugReportPaths()
1818

1919
public static bool IsFull()
2020
{
21-
return Directory.EnumerateFiles(LogsPath).Count() >= FilesLimit;
21+
return Directory.Exists(LogsPath) && Directory.EnumerateFiles(LogsPath).Count() >= FilesLimit;
2222
}
2323

2424
public static void CreateBugReport(string assetName, string assetContent, Exception exception)

Assets/UnityEventTracker/Scripts/Editor/Window/Tabs/BaseGroupedMethodsTab.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ internal override void OnEnable()
2626

2727
internal override void Draw()
2828
{
29-
using (new EditorGUIUtils.HorizontalGroupScope())
29+
using (new GUILayout.HorizontalScope())
3030
{
3131
if (_groupedCalls?.Length == 0)
3232
return;
@@ -213,7 +213,6 @@ private void DrawMethodCandidates()
213213
_shouldUpdateMethodsCandidatesList = true;
214214

215215
GUILayout.Space(10);
216-
217216
using (new EditorGUI.DisabledGroupScope(_selectedStaticMethodToReplace < 0 &&
218217
_selectedDynamicMethodToReplace < 0))
219218
{
@@ -238,7 +237,7 @@ private void DrawMethodCandidates()
238237
private IDisposable GetVerticalGroup()
239238
{
240239
var width = Rect.width / 3f;
241-
return new EditorGUIUtils.VerticalGroupScope(EditorStyles.helpBox, GUILayout.Width(width));
240+
return new GUILayout.VerticalScope(EditorStyles.helpBox, GUILayout.Width(width));
242241
}
243242
}
244243
}

Assets/UnityEventTracker/Scripts/Editor/Window/Tabs/BaseNonMethodsTab.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using System;
22
using System.Linq;
33
using UnityEditor;
4+
using UnityEngine;
45
using UnityEventTracker.DataClasses;
56

67
namespace UnityEventTracker.EditorWindow
@@ -16,9 +17,9 @@ internal override void OnEnable()
1617

1718
internal override void Draw()
1819
{
19-
using (new EditorGUIUtils.HorizontalGroupScope())
20+
using (new GUILayout.HorizontalScope())
2021
{
21-
using (new EditorGUIUtils.VerticalGroupScope(EditorStyles.helpBox))
22+
using (new GUILayout.VerticalScope(EditorStyles.helpBox))
2223
{
2324
DrawAssets(Rect.width);
2425
}

Assets/UnityEventTracker/Scripts/Editor/Window/Tabs/BaseTab.cs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,13 @@ private void DrawActiveAsset(AssetInfo assetInfo, float width)
174174
{
175175
var fileContent = assetInfo.GuiContent;
176176

177-
using (new VerticalGroupScope(EditorStyles.helpBox, Color.green))
177+
var defaultColor = GUI.color;
178+
GUI.color = Color.green;
179+
180+
using (new GUILayout.VerticalScope(EditorStyles.helpBox))
178181
{
182+
GUI.color = defaultColor;
183+
179184
using (new ColorScope(
180185
ColorScope.ColorOrDefault(() => assetInfo.Asset.IsDirty(), new Color(0.91f, 0.44f, 0.26f, 1),
181186
ColorType.All),
@@ -198,10 +203,8 @@ private void DrawActiveAsset(AssetInfo assetInfo, float width)
198203
if (target == null)
199204
{
200205
using (new ColorScope(Color.red, ColorType.Background))
201-
{
202206
GUILayout.Button("Deleted");
203-
}
204-
207+
205208
continue;
206209
}
207210

@@ -215,7 +218,7 @@ private void DrawActiveAsset(AssetInfo assetInfo, float width)
215218
}
216219
}
217220

218-
private void DrawNonActiveAsset(AssetInfo assetInfo, float width)
221+
private static void DrawNonActiveAsset(AssetInfo assetInfo, float width)
219222
{
220223
var asset = assetInfo.Asset;
221224
var fileContent = assetInfo.GuiContent;

0 commit comments

Comments
 (0)