I have a Problem Dragging from another container to a shape grid. It throws an error in ItemShapeDropPreviewItemView.ClearGridColorPreview because ItemShapeGrid is null.
ItemShapeGrid is referenced to ItemShapeItemView.ItemShapeGrid
I think this may have broken when I recently upgraded. I restored an old copy of my project and this works without error. I confirmed all the properties on the Shape Grid match the old project. I have another shapegrid in the scene, this works without error. But again the properties appear to be identical between the two grids.
I can't work out what what has changed to cause this. Do you know what might cause this error?
I have posted a short video showing the problem and properties.
I put a try/catch around the error so I can see the stack:
ITEMSHAPE: Object reference not set to an instance of an object
UnityEngine.Debug:Log (object)
Opsive.UltimateInventorySystem.UI.Item.ItemViewModules.ItemShapeDropPreviewItemView:ClearGridColorPreview () (at Assets/Opsive/UltimateInventorySystem/Scripts/UI/Item/ItemViewModules/ItemShapeDropPreviewItemView.cs:110)
Opsive.UltimateInventorySystem.UI.Item.ItemViewModules.ItemShapeDropPreviewItemView:SelectWith (Opsive.UltimateInventorySystem.UI.Item.DragAndDrop.ItemViewDropHandler) (at Assets/Opsive/UltimateInventorySystem/Scripts/UI/Item/ItemViewModules/ItemShapeDropPreviewItemView.cs:88)
Opsive.UltimateInventorySystem.UI.Item.DragAndDrop.ItemViewDropHandler:ItemViewSlotSelected (Opsive.UltimateInventorySystem.UI.Item.ItemViewSlotEventData) (at Assets/DeadFear/Opsive/UltimateInventorySystem/Scripts/Custom/UI/UI/Grid/Item/DragAndDrop/ItemViewDropHandler.cs:285)
Opsive.UltimateInventorySystem.UI.Item.ItemViewSlotsContainerBase/<>c__DisplayClass76_0:<Initialize>b__1 () (at Assets/Opsive/UltimateInventorySystem/Scripts/UI/Item/ItemViewSlotsContainerBase.cs:218)
Opsive.UltimateInventorySystem.UI.CompoundElements.ActionButton:OnSelect (UnityEngine.EventSystems.BaseEventData) (at Assets/Opsive/UltimateInventorySystem/Scripts/UI/CompoundElements/ActionButton.cs:316)
Opsive.UltimateInventorySystem.UI.Item.ItemViewSlot:OnSelect (UnityEngine.EventSystems.BaseEventData) (at Assets/Opsive/UltimateInventorySystem/Scripts/UI/Item/ItemViewSlot.cs:106)
Opsive.UltimateInventorySystem.UI.Item.ItemViewSlot:SetItemInfo (Opsive.UltimateInventorySystem.Core.DataStructures.ItemInfo) (at Assets/Opsive/UltimateInventorySystem/Scripts/UI/Item/ItemViewSlot.cs:79)
Opsive.UltimateInventorySystem.UI.Item.ItemViewSlotsContainerBase:AssignItemToSlot (Opsive.UltimateInventorySystem.Core.DataStructures.ItemInfo,int) (at Assets/Opsive/UltimateInventorySystem/Scripts/UI/Item/ItemViewSlotsContainerBase.cs:407)
Opsive.UltimateInventorySystem.UI.Grid.ItemShapeGridrawInternal () (at Assets/Opsive/UltimateInventorySystem/Scripts/UI/Grid/ItemShapeGrid.cs:300)
Opsive.UltimateInventorySystem.UI.Item.ItemViewSlotsContainerBase:LateUpdate () (at Assets/Opsive/UltimateInventorySystem/Scripts/UI/Item/ItemViewSlotsContainerBase.cs:676)
EDIT: In the video, moving within the shape grid appeared to misbehave. But typically if the item is in the grid and I am just moving its position, there is no problem. The error only appears to occur when dragging from another container.
ItemShapeGrid is referenced to ItemShapeItemView.ItemShapeGrid
I think this may have broken when I recently upgraded. I restored an old copy of my project and this works without error. I confirmed all the properties on the Shape Grid match the old project. I have another shapegrid in the scene, this works without error. But again the properties appear to be identical between the two grids.
I can't work out what what has changed to cause this. Do you know what might cause this error?
I have posted a short video showing the problem and properties.
I put a try/catch around the error so I can see the stack:
ITEMSHAPE: Object reference not set to an instance of an object
UnityEngine.Debug:Log (object)
Opsive.UltimateInventorySystem.UI.Item.ItemViewModules.ItemShapeDropPreviewItemView:ClearGridColorPreview () (at Assets/Opsive/UltimateInventorySystem/Scripts/UI/Item/ItemViewModules/ItemShapeDropPreviewItemView.cs:110)
Opsive.UltimateInventorySystem.UI.Item.ItemViewModules.ItemShapeDropPreviewItemView:SelectWith (Opsive.UltimateInventorySystem.UI.Item.DragAndDrop.ItemViewDropHandler) (at Assets/Opsive/UltimateInventorySystem/Scripts/UI/Item/ItemViewModules/ItemShapeDropPreviewItemView.cs:88)
Opsive.UltimateInventorySystem.UI.Item.DragAndDrop.ItemViewDropHandler:ItemViewSlotSelected (Opsive.UltimateInventorySystem.UI.Item.ItemViewSlotEventData) (at Assets/DeadFear/Opsive/UltimateInventorySystem/Scripts/Custom/UI/UI/Grid/Item/DragAndDrop/ItemViewDropHandler.cs:285)
Opsive.UltimateInventorySystem.UI.Item.ItemViewSlotsContainerBase/<>c__DisplayClass76_0:<Initialize>b__1 () (at Assets/Opsive/UltimateInventorySystem/Scripts/UI/Item/ItemViewSlotsContainerBase.cs:218)
Opsive.UltimateInventorySystem.UI.CompoundElements.ActionButton:OnSelect (UnityEngine.EventSystems.BaseEventData) (at Assets/Opsive/UltimateInventorySystem/Scripts/UI/CompoundElements/ActionButton.cs:316)
Opsive.UltimateInventorySystem.UI.Item.ItemViewSlot:OnSelect (UnityEngine.EventSystems.BaseEventData) (at Assets/Opsive/UltimateInventorySystem/Scripts/UI/Item/ItemViewSlot.cs:106)
Opsive.UltimateInventorySystem.UI.Item.ItemViewSlot:SetItemInfo (Opsive.UltimateInventorySystem.Core.DataStructures.ItemInfo) (at Assets/Opsive/UltimateInventorySystem/Scripts/UI/Item/ItemViewSlot.cs:79)
Opsive.UltimateInventorySystem.UI.Item.ItemViewSlotsContainerBase:AssignItemToSlot (Opsive.UltimateInventorySystem.Core.DataStructures.ItemInfo,int) (at Assets/Opsive/UltimateInventorySystem/Scripts/UI/Item/ItemViewSlotsContainerBase.cs:407)
Opsive.UltimateInventorySystem.UI.Grid.ItemShapeGridrawInternal () (at Assets/Opsive/UltimateInventorySystem/Scripts/UI/Grid/ItemShapeGrid.cs:300)
Opsive.UltimateInventorySystem.UI.Item.ItemViewSlotsContainerBase:LateUpdate () (at Assets/Opsive/UltimateInventorySystem/Scripts/UI/Item/ItemViewSlotsContainerBase.cs:676)
EDIT: In the video, moving within the shape grid appeared to misbehave. But typically if the item is in the grid and I am just moving its position, there is no problem. The error only appears to occur when dragging from another container.
Last edited: