Unity-Technologies / 2d-extras

Fun 2D Stuff that we'd like to share!
Other
1.54k stars 342 forks source link

NullReferenceException when using Tile Palette #361

Closed phllpbll189 closed 1 year ago

phllpbll189 commented 1 year ago

When I try to paint a tilemap with the tile palette open in the side It throws an error every time. I have tiles selected and the brush active as well as trying to edit the prefab. Here is the error.

UnityEditor.Tilemaps.GridPaintPaletteClipboard.HandleDragAndDrop () (at Library/PackageCache/com.unity.2d.tilemap@1.0.0/Editor/GridPaintPaletteClipboard.cs:726)
UnityEditor.Tilemaps.GridPaintPaletteClipboard.OnGUI () (at Library/PackageCache/com.unity.2d.tilemap@1.0.0/Editor/GridPaintPaletteClipboard.cs:369)
UnityEditor.Tilemaps.GridPaintPaletteWindow.OnClipboardGUI (UnityEngine.Rect position) (at Library/PackageCache/com.unity.2d.tilemap@1.0.0/Editor/GridPaintPaletteWindow.cs:1260)
UnityEditor.Tilemaps.GridPaintPaletteWindow.OnGUI () (at Library/PackageCache/com.unity.2d.tilemap@1.0.0/Editor/GridPaintPaletteWindow.cs:498)
UnityEditor.HostView.InvokeOnGUI (UnityEngine.Rect onGUIPosition) (at <44a70d1b13cf47e29810e30f45ffae08>:0)
UnityEditor.DockArea.DrawView (UnityEngine.Rect dockAreaRect) (at <44a70d1b13cf47e29810e30f45ffae08>:0)
UnityEditor.DockArea.OldOnGUI () (at <44a70d1b13cf47e29810e30f45ffae08>: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 <7096c6494db14f0c807ca461735e58a8>:0)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, UnityEngine.Matrix4x4 worldTransform, UnityEngine.Rect clippingRect, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <7096c6494db14f0c807ca461735e58a8>:0)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <7096c6494db14f0c807ca461735e58a8>:0)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, System.Boolean canAffectFocus) (at <7096c6494db14f0c807ca461735e58a8>:0)
UnityEngine.UIElements.IMGUIContainer.SendEventToIMGUIRaw (UnityEngine.UIElements.EventBase evt, System.Boolean canAffectFocus, System.Boolean verifyBounds) (at <7096c6494db14f0c807ca461735e58a8>:0)
UnityEngine.UIElements.IMGUIContainer.SendEventToIMGUI (UnityEngine.UIElements.EventBase evt, System.Boolean canAffectFocus, System.Boolean verifyBounds) (at <7096c6494db14f0c807ca461735e58a8>:0)
UnityEngine.UIElements.IMGUIContainer.HandleEvent (UnityEngine.UIElements.EventBase evt) (at <7096c6494db14f0c807ca461735e58a8>:0)
UnityEngine.UIElements.EventDispatchUtilities.PropagateEvent (UnityEngine.UIElements.EventBase evt) (at <7096c6494db14f0c807ca461735e58a8>:0)
UnityEngine.UIElements.MouseEventDispatchingStrategy.SendEventToRegularTarget (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.BaseVisualElementPanel panel) (at <7096c6494db14f0c807ca461735e58a8>:0)
UnityEngine.UIElements.MouseEventDispatchingStrategy.SendEventToTarget (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.BaseVisualElementPanel panel) (at <7096c6494db14f0c807ca461735e58a8>:0)
UnityEngine.UIElements.MouseEventDispatchingStrategy.DispatchEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel iPanel) (at <7096c6494db14f0c807ca461735e58a8>:0)
UnityEngine.UIElements.EventDispatcher.ApplyDispatchingStrategies (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, System.Boolean imguiEventIsInitiallyUsed) (at <7096c6494db14f0c807ca461735e58a8>:0)
UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <7096c6494db14f0c807ca461735e58a8>:0)
UnityEngine.UIElements.EventDispatcher.Dispatch (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, UnityEngine.UIElements.DispatchMode dispatchMode) (at <7096c6494db14f0c807ca461735e58a8>:0)
UnityEngine.UIElements.BaseVisualElementPanel.SendEvent (UnityEngine.UIElements.EventBase e, UnityEngine.UIElements.DispatchMode dispatchMode) (at <7096c6494db14f0c807ca461735e58a8>:0)
UnityEngine.UIElements.UIElementsUtility.DoDispatch (UnityEngine.UIElements.BaseVisualElementPanel panel) (at <7096c6494db14f0c807ca461735e58a8>:0)
UnityEngine.UIElements.UIElementsUtility.UnityEngine.UIElements.IUIElementsUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr, System.Boolean& eventHandled) (at <7096c6494db14f0c807ca461735e58a8>:0)
UnityEngine.UIElements.UIEventRegistration.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at <7096c6494db14f0c807ca461735e58a8>:0)
UnityEngine.UIElements.UIEventRegistration+<>c.<.cctor>b__1_2 (System.Int32 i, System.IntPtr ptr) (at <7096c6494db14f0c807ca461735e58a8>:0)
UnityEngine.GUIUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr, System.Boolean& result) (at <89d2c0fe37e0454991daf2807b7dcb63>:0)
phllpbll189 commented 1 year ago

So I removed it a third time and reinstalled it. Also I switched from the default brush to the GameObject Brush. This allowed me to paint into my tilemap. Not sure if this will help anyone but I sure hope it does!

ChuanXin-Unity commented 1 year ago

@phllpbll189 Sorry about this issue! Would it be possible to share which version of the Unity Editor you are using when you faced this issue? Thanks!

If you could share more details by filing a bug report with your project and posting the case number here, that would be great!

phllpbll189 commented 1 year ago

@ChuanXin-Unity it was on version 2021.3.6f1. I'm now on version 2021.3.20f1 and haven't run into any issues!