Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NullReferenceException with tileOverlay.ShowWindow() in provided sample scene #2

Closed
BradFitz66 opened this issue Jan 22, 2021 · 3 comments
Labels
bug Something isn't working released

Comments

@BradFitz66
Copy link

Upon attempting to do anything on in the sample scene, I get a NullReferenceException when selecting a tileset.

NullReferenceException: Object reference not set to an instance of an object
MeshTilesetsEditor.TilesetRendererEditor.OnSceneGUI () (at Assets/unity-mesh-tilesets-1.0.3/Assets/Mesh Tilesets/Editor/TilesetRendererEditor.cs:173)
System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at :0)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at :0)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at :0)
UnityEditor.SceneView.CallOnSceneGUI () (at :0)
UnityEditor.SceneView.HandleSelectionAndOnSceneGUI () (at :0)
UnityEditor.SceneView.OnGUI () (at :0)
System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at :0)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at :0)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at :0)
UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at :0)
UnityEditor.HostView.Invoke (System.String methodName) (at :0)
UnityEditor.HostView.InvokeOnGUI (UnityEngine.Rect onGUIPosition, UnityEngine.Rect viewRect) (at :0)
UnityEditor.DockArea.DrawView (UnityEngine.Rect viewRect, UnityEngine.Rect dockAreaRect) (at :0)
UnityEditor.DockArea.OldOnGUI () (at :0)
UnityEngine.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, UnityEngine.Matrix4x4 parentTransform, UnityEngine.Rect clippingRect, System.Boolean isComputingLayout, UnityEngine.Rect layoutSize, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <78b213560771414e9fa6f1b95f5ad8bb>:0)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, UnityEngine.Matrix4x4 worldTransform, UnityEngine.Rect clippingRect, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <78b213560771414e9fa6f1b95f5ad8bb>:0)
UnityEngine.UIElements.IMGUIContainer.DoIMGUIRepaint () (at <78b213560771414e9fa6f1b95f5ad8bb>:0)
UnityEngine.UIElements.UIR.RenderChainCommand.ExecuteNonDrawMesh (UnityEngine.UIElements.UIR.DrawParams drawParams, System.Boolean straightY, System.Single pixelsPerPoint, System.Exception& immediateException) (at <78b213560771414e9fa6f1b95f5ad8bb>:0)
Rethrow as ImmediateModeException
UnityEngine.UIElements.UIR.RenderChain.Render (UnityEngine.Rect viewport, UnityEngine.Matrix4x4 projection, UnityEngine.UIElements.PanelClearFlags clearFlags) (at <78b213560771414e9fa6f1b95f5ad8bb>:0)
UnityEngine.UIElements.UIRRepaintUpdater.DrawChain (UnityEngine.Rect viewport, UnityEngine.Matrix4x4 projection) (at <78b213560771414e9fa6f1b95f5ad8bb>:0)
UnityEngine.UIElements.UIRRepaintUpdater.Update () (at <78b213560771414e9fa6f1b95f5ad8bb>:0)
UnityEngine.UIElements.VisualTreeUpdater.UpdateVisualTreePhase (UnityEngine.UIElements.VisualTreeUpdatePhase phase) (at <78b213560771414e9fa6f1b95f5ad8bb>:0)
UnityEngine.UIElements.Panel.UpdateForRepaint () (at <78b213560771414e9fa6f1b95f5ad8bb>:0)
UnityEngine.UIElements.Panel.Repaint (UnityEngine.Event e) (at <78b213560771414e9fa6f1b95f5ad8bb>:0)
UnityEngine.UIElements.UIElementsUtility.DoDispatch (UnityEngine.UIElements.BaseVisualElementPanel panel) (at <78b213560771414e9fa6f1b95f5ad8bb>:0)
UnityEngine.UIElements.UIElementsUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at <78b213560771414e9fa6f1b95f5ad8bb>:0)
UnityEngine.GUIUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at <819de1aa368e45faa4f78e26c97c62b0>:0)

which goes to this line

tileOverlay.ShowWindow();

@FreshlyBrewedCode
Copy link
Owner

Hi, thanks for the report. Could you specify which version of Unity you are using? Also, are you on PC or Mac? Thanks!

@FreshlyBrewedCode FreshlyBrewedCode added the bug Something isn't working label Jan 22, 2021
github-actions bot pushed a commit that referenced this issue Jan 23, 2021
## [1.0.4](v1.0.3...v1.0.4) (2021-01-23)

### Bug Fixes

* adjust reflection code in `SceneOverlayWindow` for Unity 2019 ([8cff072](8cff072)), closes [#2](#2)
* fix incorrect height for first flag in `TilesetFlagsMaskDrawer` ([5939246](5939246))
* Unity 2020 code for `SceneOverlayWindow` ([6194578](6194578))
@github-actions
Copy link

🎉 This issue has been resolved in version 1.0.4 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

github-actions bot pushed a commit that referenced this issue Jan 23, 2021
## [1.0.4](v1.0.3...v1.0.4) (2021-01-23)

### Bug Fixes

* adjust reflection code in `SceneOverlayWindow` for Unity 2019 ([8cff072](8cff072)), closes [#2](#2)
* fix incorrect height for first flag in `TilesetFlagsMaskDrawer` ([5939246](5939246))
* Unity 2020 code for `SceneOverlayWindow` ([6194578](6194578))
@FreshlyBrewedCode
Copy link
Owner

FreshlyBrewedCode commented Jan 23, 2021

@BradFitz66 I added a fix to make the tile overlay window work in Unity 2019. I assume this was the cause of the NullReferenceException you encountered. I would appreciate if you could update to version 1.0.4 and see if the problem is solved. If not feel free to reopen the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working released
Projects
None yet
Development

No branches or pull requests

2 participants