Drag item encounter an exceptation

Justus

Member
The Drag and move function works well in my project.
But during every Play Mode, the first time I drag out an item from its slot will arise following exception. And clue about it?
1651745240260.png
 
I'm guessing this might be related to one of the new scripts I gave you.

Try changing the part of the script that is giving your the error to this:
Code:
var sourceCanGive = itemViewDropHandler.SourceContainer?.CanGiveItem(
    itemViewDropHandler.SourceItemInfo,
    itemViewDropHandler.SourceIndex) ?? false;
var destinationCanGive = itemViewDropHandler.DestinationContainer?.CanGiveItem(
    itemViewDropHandler.DestinationItemInfo,
    itemViewDropHandler.DestinationIndex) ?? false;
var sourceCanAdd = itemViewDropHandler.SourceContainer?.CanAddItem(
    itemViewDropHandler.StreamData.DestinationItemInfo,
    itemViewDropHandler.SourceIndex) ?? false;
var destinationCanAdd = itemViewDropHandler.DestinationContainer?.CanAddItem(
    itemViewDropHandler.StreamData.SourceItemInfo,
    itemViewDropHandler.DestinationIndex) ?? false;

Let me know if that fixes it
 
Works perfectly! Please add this to next update~.

for anyone who also need this, I list my file locatoin below. My current UIS version is 1.2.8
Assets\Opsive\UltimateInventorySystem\Scripts\UI\Item\DragAndDrop\DropActions\ItemViewDropContainerSmartExchangeAction.cs::line36

1651804635936.png
 
Top