Skip to content

Commit 786cca1

Browse files
committed
Merge branch 'issue/dbrizov#133-inspector-lag'
2 parents da6a22a + c74bcb8 commit 786cca1

File tree

1 file changed

+13
-22
lines changed

1 file changed

+13
-22
lines changed

Assets/NaughtyAttributes/Scripts/Editor/NaughtyInspector.cs

+13-22
Original file line numberDiff line numberDiff line change
@@ -11,37 +11,26 @@ namespace NaughtyAttributes.Editor
1111
[CustomEditor(typeof(UnityEngine.Object), true)]
1212
public class NaughtyInspector : UnityEditor.Editor
1313
{
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;
1818

19-
private List<NaughtyProperty> _nonGroupedSerializedProperty;
19+
protected List<NaughtyProperty> _nonGroupedSerializedProperty;
20+
protected SerializedProperty m_ScriptProperty;
2021

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;
2624

2725
private Dictionary<string, SavedBool> _foldouts = new Dictionary<string, SavedBool>();
2826

2927
private bool _anyNaughtyAttribute;
30-
private bool _useCachedMetaAttributes;
31-
private bool _changeDetected;
28+
29+
protected bool _useCachedMetaAttributes;
30+
protected bool _changeDetected;
3231

3332
protected virtual void OnEnable()
3433
{
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-
4534
this.Prepare();
4635
}
4736

@@ -53,6 +42,8 @@ protected virtual void OnDisable()
5342
_nonSerializedFields.Clear();
5443
_nativeProperties.Clear();
5544
_methods.Clear();
45+
_foldouts.Clear();
46+
5647
_foldoutGroupedSerializedProperty.Clear();
5748
_groupedSerialzedProperty.Clear();
5849
_nonGroupedSerializedProperty.Clear();

0 commit comments

Comments
 (0)