jimi
Member
Hi there,
Is there a way to get the current equipped item in order to unequip it during an ItemAction of a different Item?
Looking to unequip all before executing a method.
I tried equipping the body ItemDefinition by referencing it via an attribute but that doesn't quite work either.
Thanks
Is there a way to get the current equipped item in order to unequip it during an ItemAction of a different Item?
Looking to unequip all before executing a method.
I tried equipping the body ItemDefinition by referencing it via an attribute but that doesn't quite work either.
C#:
protected override void InvokeActionInternal(ItemInfo itemInfo, ItemUser itemUser)
{
var HandsDeff = itemInfo.Item.GetAttribute<Attribute<ItemDefinition>>("Body").GetValue();
var HandsItemInfo = itemInfo.Inventory.GetItemInfo(HandsDeff as ItemDefinition);
InventorySystemManager.GetDisplayPanelManager(1).CloseMainMenu();
EventHandler.ExecuteEvent(itemUser.gameObject, "OnEnableGameplayInput", false);
EventHandler.ExecuteEvent<ItemInfo, bool>(itemInfo.Inventory.gameObject, "OnItemActionEquipUnequip", (ItemInfo)HandsItemInfo, true);
EventHandler.ExecuteEvent<ItemInfo>(itemInfo.Inventory.gameObject, "OnItemActionPlace", itemInfo);
}