ShapesRenderEditor throwing exceptions when playing in editor
I don't recall seeing this before, so not sure what caused it, but in the editor every time I hit Play to test out my game, I see a series of four errors in the console that seem to tie into the ShapesRenderEditor trying to create a SerilizedObject. I'm not sure why editor code is even running at this point, but that is what I'm seeing:
NullReferenceException: Object reference not set to an instance of an object UnityEditor.GameObjectInspector.OnDisable () (at <94e1644530894ca4afcc0afbfd6605d3>:0)
SerializedObjectNotCreatableException: Object at index 0 is null UnityEditor.Editor.CreateSerializedObject () (at <94e1644530894ca4afcc0afbfd6605d3>:0) UnityEditor.Editor.GetSerializedObjectInternal () (at <94e1644530894ca4afcc0afbfd6605d3>:0) UnityEditor.Editor.get_serializedObject () (at <94e1644530894ca4afcc0afbfd6605d3>:0) UnityEditor.TransformInspector.OnEnable () (at <94e1644530894ca4afcc0afbfd6605d3>:0)
InvalidCastException: Specified cast is not valid. Shapes.ShapeRendererEditor+<>c.<onenable>b__36_0 (UnityEngine.Object t) (at Assets/Shapes/Scripts/Editor/Components/ShapeRendererEditor.cs:108) System.Linq.Enumerable+SelectArrayIterator`2[TSource,TResult].ToArray () (at <83c2e80c632943a485c1e12619e4eddd>:0) System.Linq.Enumerable.ToArray[TSource] (System.Collections.Generic.IEnumerable`1[T] source) (at <83c2e80c632943a485c1e12619e4eddd>:0) Shapes.ShapeRendererEditor.OnEnable () (at Assets/Shapes/Scripts/Editor/Components/ShapeRendererEditor.cs:108) Shapes.DiscEditor.OnEnable () (at Assets/Shapes/Scripts/Editor/Components/DiscEditor.cs:35)</onenable>
MissingReferenceException: The variable m_Targets of GameObjectInspector doesn't exist anymore. You probably need to reassign the m_Targets variable of the 'GameObjectInspector' script in the inspector. Parameter name: componentOrGameObject UnityEngine.Object+MarshalledUnityObject.TryThrowEditorNullExceptionObject (UnityEngine.Object unityObj, System.String parameterName) (at <2cc8976df9884fb7bcb48c3f3813f67b>:0) UnityEngine.Bindings.ThrowHelper.ThrowArgumentNullException (System.Object obj, System.String parameterName) (at <2cc8976df9884fb7bcb48c3f3813f67b>:0) UnityEditor.PrefabUtility.IsPartOfVariantPrefab (UnityEngine.Object componentOrGameObject) (at <94e1644530894ca4afcc0afbfd6605d3>:0) UnityEditor.GameObjectInspector.OnEnable () (at <94e1644530894ca4afcc0afbfd6605d3>:0)
Based on the errors, I'm guessing it has something to do with my game spawning prefabs that contain Shapes components in both enabled and disabled states, but that is JUST a guess.
Reporting a bug? please specify Unity version:
6000.2.0a4
Reporting a bug? please specify Shapes version:
4.5.1
Reporting a bug? please specify Render Pipeline:
URP