@@ -8,7 +8,7 @@ namespace Spiral.EditorTools.DeadScriptsSearcher
8
8
{
9
9
public class DeadWindow : EditorWindow
10
10
{
11
- private readonly DeadScripts deadscript = new DeadScripts ( ) ;
11
+ private readonly DeadScripts deadscript = new DeadScripts ( ) { debug = false } ;
12
12
public Local lang = Local . RU ;
13
13
14
14
// LOCALIZATION ===========================================================================
@@ -99,7 +99,7 @@ public class DeadWindow : EditorWindow
99
99
// en
100
100
"Unique GUIDs found:"
101
101
) ;
102
- private readonly static LocalString strShowDeadGUIDs = new LocalString (
102
+ private readonly static LocalString strShowList = new LocalString (
103
103
// ru
104
104
"Показать/Скрыть список" ,
105
105
// en
@@ -110,11 +110,16 @@ public class DeadWindow : EditorWindow
110
110
"Объектов" ,
111
111
// en
112
112
"Objects count" ) ;
113
- private readonly static LocalString strSelectOnScene = new LocalString (
113
+ private readonly static LocalString strSelectObjects = new LocalString (
114
114
// ru
115
- "Выбрать на сцене " ,
115
+ "Выделить все объекты с этим скриптом " ,
116
116
// en
117
- "Select on the scene" ) ;
117
+ "Select all objects with this script" ) ;
118
+ private readonly static LocalString strSelectObject = new LocalString (
119
+ // ru
120
+ "Выделить объект" ,
121
+ // en
122
+ "Select target object" ) ;
118
123
#endregion
119
124
120
125
// MENU INITIALIZATION ====================================================================
@@ -213,7 +218,7 @@ private void ShowDeadGUIDs()
213
218
{
214
219
EditorGUI . indentLevel += 1 ;
215
220
foldoutDeads = EditorGUILayout . Foldout ( foldoutDeads ,
216
- strShowDeadGUIDs . Read ( lang ) ,
221
+ strShowList . Read ( lang ) ,
217
222
true , EditorStyles . foldout ) ;
218
223
EditorGUI . indentLevel -= 1 ;
219
224
}
@@ -227,19 +232,58 @@ private void ShowDeadGUIDs()
227
232
for ( int i = 0 ; i < deadscript . deadGUIDs . Count ; i ++ )
228
233
{
229
234
DeadGUID dead = deadscript . deadGUIDs [ i ] ;
235
+ DrawDeadGUIDEntry ( dead ) ;
236
+ }
237
+ }
238
+ EditorGUILayout . EndVertical ( ) ;
239
+ }
240
+
241
+ private void DrawDeadGUIDEntry ( DeadGUID dead )
242
+ {
243
+ GUI . color = new Color ( 0.5f , 0.5f , 0.5f ) ;
244
+ EditorGUILayout . BeginVertical ( EditorStyles . helpBox ) ;
245
+ GUI . color = defaultColor ;
246
+
247
+ EditorGUILayout . SelectableLabel ( $ "GUID: { dead . guid } ", GUILayout . MinWidth ( 250 ) ) ;
230
248
231
- EditorGUILayout . BeginVertical ( EditorStyles . helpBox ) ;
232
- EditorGUILayout . LabelField ( $ "GUID #{ i } ", EditorStyles . miniBoldLabel ) ;
233
- EditorGUILayout . SelectableLabel ( $ "{ dead . guid } ", EditorStyles . label ) ;
234
- EditorGUILayout . LabelField ( $ "{ strDeadObjectsCount . Read ( lang ) } : { dead . oids . Count } ",
235
- EditorStyles . miniBoldLabel ) ;
236
- if ( GUILayout . Button ( strSelectOnScene . Read ( lang ) ) )
249
+ string strDeadCount = $ "{ strDeadObjectsCount . Read ( lang ) } : { dead . oids . Count } ";
250
+
251
+ dead . showInfo = EditorGUILayout . Foldout ( dead . showInfo , strDeadCount ) ;
252
+ if ( dead . showInfo )
253
+ {
254
+ for ( int i = 0 ; i < dead . gids . Count ; i ++ )
255
+ {
256
+ var dgid = dead . gids [ i ] ;
257
+ var dgidID = dgid . gid ;
258
+
259
+ string strGID = $ "{ dgidID } ";
260
+ string strButtonName = $ "#{ i } MonoBehaviour ID: { strGID } ";
261
+ if ( EditorGUILayout . DropdownButton ( new GUIContent ( strButtonName ) , FocusType . Passive ) )
262
+ {
263
+ dgid . showInfo = ! dgid . showInfo ;
264
+ }
265
+ if ( dgid . showInfo )
237
266
{
238
- ObjectID . Select ( dead . oids ) ;
267
+ EditorGUILayout . BeginVertical ( EditorStyles . helpBox ) ;
268
+ EditorGUILayout . SelectableLabel ( strGID ) ;
269
+ if ( GUILayout . Button ( strSelectObject . Read ( lang ) ) )
270
+ {
271
+ Selection . objects = new Object [ 1 ] { dead . oids [ i ] . gameObject } ;
272
+ }
273
+ GUI . enabled = false ;
274
+ EditorGUILayout . TextArea ( dgid . entry ) ;
275
+ GUI . enabled = true ;
276
+ EditorGUILayout . Space ( ) ;
277
+ EditorGUILayout . EndVertical ( ) ;
239
278
}
240
- EditorGUILayout . EndVertical ( ) ;
241
279
}
242
280
}
281
+
282
+ if ( GUILayout . Button ( strSelectObjects . Read ( lang ) ) )
283
+ {
284
+ ObjectID . Select ( dead . oids ) ;
285
+ }
286
+
243
287
EditorGUILayout . EndVertical ( ) ;
244
288
}
245
289
@@ -248,8 +292,10 @@ private void ShowDeadGUIDs()
248
292
// Editor Window's Mono
249
293
//=========================================================================================
250
294
Vector2 scrollPos ;
295
+ Color defaultColor = Color . white ;
251
296
private void OnGUI ( )
252
297
{
298
+ defaultColor = GUI . color ;
253
299
switch ( lang )
254
300
{
255
301
case Local . RU :
@@ -275,6 +321,7 @@ private void OnGUI()
275
321
EditorGUILayout . EndScrollView ( ) ;
276
322
277
323
EditorGUILayout . EndVertical ( ) ;
324
+ GUI . color = defaultColor ;
278
325
}
279
326
}
280
327
}
0 commit comments