What's the best way to use UIS ItemHotbar(without changing Item's ItemCollection) in UCC?

WeiYiHua

Member
Hello!
I want UCC EquipUnequip to work with UIS ItemHotbar.

In this case, ItemInfos of ItemHotbar is only stored inside ItemHotbar. So I tried copying the ItemInfos to a new ItemCollection for CharacterInventoryBridge to monitor. But this breaks the uniqueness of Item.

So I think I can put whether Item is inside ItemHotbar and SlotIndex into Item's Attributes. Then let CharacterInventoryBridge check Attributes to get which item is in ItemHotbar. At last soft equip the items in the ItemHotbar.

Please let me know if you have a better way, thanks!
 
Last edited:
Why not use an equipment panel (aka itemSlotCollectionView) as your ItemHotbar?
You can find an example of that in the UIS Feature scenes, There should be two scenes for hotbars with different examples and some instructions on how to set them up
 
I know that.
I didn't use it because I didn't want to move the ItemCollection of the Item. I want items to be displayed in both Grid and ItemHotbar.
 
n this case, ItemInfos of ItemHotbar is only stored inside ItemHotbar. So I tried copying the ItemInfos to a new ItemCollection for CharacterInventoryBridge to monitor. But this breaks the uniqueness of Item.
There is a restriction with items, a Unique Item CANNOT be in more than one ItemCollection. if you try adding it the item is duplicated and given a new ID.
The reason I added this restriction is because allowing items to be added in multiple places with the same ID would cause alot of extremely complex bugs that are hard to indentify or fix.

If you want to keep track of the ItemInfo you'll have to create a list of ItemInfo somewhere in a custom script.
Or make a custom ItemCollection that overrides the Add item function to not duplicate Items. (As long as you know exactly what you are doing that's fine)
 
Also just to clarify. The default ItemHotbar script does not change the ItemCollection of the item. But you do need to assign the items to the hotbar slots manually. In the UIS demo scene we do this with the AssignItemToHotbar ItemAction
 
Top