Hello all,
I want get the id Item, thats it's logical, it's the name of this topic
In ItemInstance i have see one function get_Item(), he return one object of type : Assets.Scripts.Core.IItem
And this Object (Assets.Scripts.Core.IItem) contain a function get_ItemId() (return (int))
I want take this int in get_ItemId.
My variable test is a ItemInstance not empty
int id = test.get_Item().get_ItemId();
I have this message.
`Assets.Scripts.Core.IItem.ItemId.get': cannot explicitly call operator or accessor.
I don't know why.
Sorry for my bad English.
Thank you in advance.
Get_ItemId on object ItemInstance
Discussion in 'Hurtworld Development' started by RD156, Dec 30, 2015.
-
Here's an example from one of my works in progress.
Code://Retrieve the players inventory PlayerInventory inventory = curPlayer.session.WorldPlayerEntity.GetComponent<PlayerInventory>(); //Get the inventory contents var invContents = inventory.Items; //Loop through each item in the inventory for (var i = 0; i < inventory.Items.Length; i++) { PrintWarning(invContents[i].Item.ItemId) + ""); }