@@ -11,37 +11,26 @@ namespace NaughtyAttributes.Editor
11
11
[ CustomEditor ( typeof ( UnityEngine . Object ) , true ) ]
12
12
public class NaughtyInspector : UnityEditor . Editor
13
13
{
14
- private List < NaughtyProperty > _serializedProperties = new List < NaughtyProperty > ( ) ;
15
- private List < FieldInfo > _nonSerializedFields ;
16
- private List < PropertyInfo > _nativeProperties ;
17
- private List < MethodInfo > _methods ;
14
+ protected List < NaughtyProperty > _serializedProperties = new List < NaughtyProperty > ( ) ;
15
+ protected List < FieldInfo > _nonSerializedFields ;
16
+ protected List < PropertyInfo > _nativeProperties ;
17
+ protected List < MethodInfo > _methods ;
18
18
19
- private List < NaughtyProperty > _nonGroupedSerializedProperty ;
19
+ protected List < NaughtyProperty > _nonGroupedSerializedProperty ;
20
+ protected SerializedProperty m_ScriptProperty ;
20
21
21
- private SerializedProperty m_ScriptProperty ;
22
-
23
- private List < IGrouping < string , NaughtyProperty > > _groupedSerialzedProperty ;
24
-
25
- private List < IGrouping < string , NaughtyProperty > > _foldoutGroupedSerializedProperty ;
22
+ protected List < IGrouping < string , NaughtyProperty > > _groupedSerialzedProperty ;
23
+ protected List < IGrouping < string , NaughtyProperty > > _foldoutGroupedSerializedProperty ;
26
24
27
25
private Dictionary < string , SavedBool > _foldouts = new Dictionary < string , SavedBool > ( ) ;
28
26
29
27
private bool _anyNaughtyAttribute ;
30
- private bool _useCachedMetaAttributes ;
31
- private bool _changeDetected ;
28
+
29
+ protected bool _useCachedMetaAttributes ;
30
+ protected bool _changeDetected ;
32
31
33
32
protected virtual void OnEnable ( )
34
33
{
35
- /*
36
- * TODO:
37
- * OnEnable is called for all monos and scriptable objects,
38
- * which eats some one time perf after compilation and also takes some memory (although not noticeable)
39
- * any other way to trigger this like via a custom editor/ window with on focus??
40
- *
41
- * Selection.selectionChanged += ????
42
- * Base Mono and SO scripts that handle this??
43
- */
44
-
45
34
this . Prepare ( ) ;
46
35
}
47
36
@@ -53,6 +42,8 @@ protected virtual void OnDisable()
53
42
_nonSerializedFields . Clear ( ) ;
54
43
_nativeProperties . Clear ( ) ;
55
44
_methods . Clear ( ) ;
45
+ _foldouts . Clear ( ) ;
46
+
56
47
_foldoutGroupedSerializedProperty . Clear ( ) ;
57
48
_groupedSerialzedProperty . Clear ( ) ;
58
49
_nonGroupedSerializedProperty . Clear ( ) ;
0 commit comments