Steps to reproduce the behavior:
Notice the following exception in editor logs:
NullReferenceException: Start Dimension Index: SerializedProperty is null
UnityEditor.EditorGUI.BeginPropertyInternal (UnityEngine.Rect totalPosition, UnityEngine.GUIContent label, UnityEditor.SerializedProperty property) (at C:/buildslave/unity/build/Editor/Mono/EditorGUI.cs:5471)
UnityEditor.EditorGUI.BeginProperty (UnityEngine.Rect totalPosition, UnityEngine.GUIContent label, UnityEditor.SerializedProperty property) (at C:/buildslave/unity/build/Editor/Mono/EditorGUI.cs:5446)
UnityEditor.EditorGUI+PropertyScope..ctor (UnityEngine.Rect totalPosition, UnityEngine.GUIContent label, UnityEditor.SerializedProperty property) (at C:/buildslave/unity/build/Editor/Mono/EditorGUI.cs:5434)
Microsoft.MixedReality.Toolkit.UI.Editor.InteractableInspector.RenderGeneralSettings () (at Assets/MixedRealityToolkit.SDK/Inspectors/UX/Interactable/InteractableInspector.cs:360)
Repros on mrtk_dev and probably on stabilization 2.1 branch.
@Troy-Ferrell , @julenka this feels like a blocking issue. I believe it is a side effect of https://github.com/microsoft/MixedRealityToolkit-Unity/pull/6104
I have a fix for this. Should I target it to stabilization ?
Yes please!
I've tried to think of a good way to prevent these kinds of regressions. The root problem is that you can't directly reference a private field; not even for a nameof(SomeClass.privateField).
On one project, to solve this problem and get auto rename fixes, I exposed public static properties that returned the nameof for each private serialized field. Not sure it's a great pattern because it's a bit much to maintain.
Another alternative is to have the inspector be a nested class of the thing that it inspects. This lets you use nameof() for privates. I think MRTK used to have some inspectors that were implemented this way. I assume there were some issues with doing it that way. If nothing else, it's a non-standard practice.
Most helpful comment
@Troy-Ferrell , @julenka this feels like a blocking issue. I believe it is a side effect of https://github.com/microsoft/MixedRealityToolkit-Unity/pull/6104
I have a fix for this. Should I target it to stabilization ?