Could you please let me know if the code below is the correct way to add a weapon and equip it to a UCC character with UIS inventory. It appears to be working. But I am not sure how to test this for completeness.
I can't follow how to use a pooled item for the weapon gameobject that is then attached to the character. Does UCC automatically pool these? or would I have to code for this, and if so, is there any tips on how to do this?
Thx.
I can't follow how to use a pooled item for the weapon gameobject that is then attached to the character. Does UCC automatically pool these? or would I have to code for this, and if so, is there any tips on how to do this?
Thx.
C#:
m_Inventory = gameObject.GetComponent<InventoryBase>();
var uisInventory = gameObject.GetComponent<Inventory>();
var itemDefinition = InventorySystemManager.GetItemDefinition("Glock");
var newItem = InventorySystemManager.CreateItem(itemDefinition);
var itemInfo = new ItemInfo((1, newItem));
uisInventory.AddItem(itemInfo);
var bridge = gameObject.GetComponent<UltimateInventorySystemBridge>();
var uccItem = bridge.GetItem(newItem, 0);
m_Inventory.EquipItem(uccItem.ItemIdentifier, 0, true);
Last edited: