Hey everyone, I’m at a bit of a loss on this. I’ll post the stack below, but this started happening in the editor after I reverted a change in one of my custom editor scripts.
Specifically, I had a line that read:
Object[] objects = FindObjectsOfType(typeof(UnityEngine.Object));
Trying to find some missing objects I changed it to:
Object[] objects = Resources.FindObjectsOfTypeAll(typeof(UnityEngine.Object));
This successfully ran, but didn’t really accomplish what I wanted so I reverted it back to:
Object[] objects = FindObjectsOfType(typeof(UnityEngine.Object));
This compiles, however, now whenever I select anything in the editor I get the following error:
NullReferenceException
UnityEngine.Graphics.Internal_DrawMeshNow2 (UnityEngine.Mesh mesh, Matrix4x4 matrix, Int32 materialIndex) (at C:/BuildAgent/work/14194e8ce88cdf47/Runtime/ExportGenerated/Editor/Graphics.cs:2335)
UnityEngine.Graphics.DrawMeshNow (UnityEngine.Mesh mesh, Matrix4x4 matrix) (at C:/BuildAgent/work/14194e8ce88cdf47/Runtime/ExportGenerated/Editor/Graphics.cs:2326)
UnityEditor.Handles.ConeCap (Int32 controlID, Vector3 position, Quaternion rotation, Single size) (at C:/BuildAgent/work/14194e8ce88cdf47/Editor/MonoGenerated/Editor/EditorHandles.cs:232)
UnityEditor.Handles.ArrowCap (Int32 controlID, Vector3 position, Quaternion rotation, Single size) (at C:/BuildAgent/work/14194e8ce88cdf47/Editor/MonoGenerated/Editor/EditorHandles.cs:327)
UnityEditorInternal.Slider1D.Do (Int32 id, Vector3 position, Vector3 direction, Single size, UnityEditor.DrawCapFunction drawFunc, Single snap) (at C:/BuildAgent/work/14194e8ce88cdf47/Editor/Mono/EditorHandles/Slider1D.cs:84)
UnityEditor.Handles.Slider (Vector3 position, Vector3 direction, Single size, UnityEditor.DrawCapFunction drawFunc, Single snap) (at C:/BuildAgent/work/14194e8ce88cdf47/Editor/MonoGenerated/Editor/EditorHandles.cs:93)
UnityEditor.Handles.DoPositionHandle_Internal (Vector3 position, Quaternion rotation) (at C:/BuildAgent/work/14194e8ce88cdf47/Editor/Mono/EditorHandles/PositionHandle.cs:71)
UnityEditor.Handles.DoPositionHandle (Vector3 position, Quaternion rotation) (at C:/BuildAgent/work/14194e8ce88cdf47/Editor/Mono/EditorHandles/PositionHandle.cs:61)
UnityEditor.Handles.PositionHandle (Vector3 position, Quaternion rotation) (at C:/BuildAgent/work/14194e8ce88cdf47/Editor/MonoGenerated/Editor/EditorHandles.cs:67)
UnityEditor.MoveTool.OnGUI () (at C:/BuildAgent/work/14194e8ce88cdf47/Editor/Mono/GUI/BuiltinTools.cs:14)
UnityEditor.SceneView.DefaultHandles () (at C:/BuildAgent/work/14194e8ce88cdf47/Editor/Mono/SceneView/SceneView.cs:970)
UnityEditor.SceneView.OnGUI () (at C:/BuildAgent/work/14194e8ce88cdf47/Editor/Mono/SceneView/SceneView.cs:722)
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture)
I have tried reverting all my files to an earlier build and it’s still happening. Anyone seen this error before? Got any idea what might be going wrong?
Thanks much,
-Memige
EDIT
Here’s a screen shot of what its doing visually in the editor