question

brendan avatar image
brendan asked

Unity: Get Item Attributes

wilderness26
started a topic on Wed, 29 April 2015 at 3:05 PM

Hey,

I want to access an Item's attributes in Unity.
I am using the following to get my user inventory:

PlayFabClientAPI.GetUserInventory (new GetUserInventoryRequest(),OnGetUserInventory, OnPlayFabError);

Then, in my OnGetUserInventory function there doesn't seem to be a way for me to access an item's attribute with the GetUserInventoryResult array that I return. I can get things like the "ItemId" and "Annotation" etc. but I don't know how to get the attributes.

Any help would be greatly appreciated! PlayFab has been great so far :)

Julian

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

brendan avatar image
brendan answered

Best Answer
Brendan Vanous said on Wed, 29 April 2015 at 5:05 PM

Thanks Julian!

Attributes are defined at the Catalog level right now, but we're working on an update which will add attributes to the Inventory as well, which should provide what you need. If this is a key need for your title, please do drop us a note at devrel@playfab.com to let us know, so that we can confirm whether our schedules align.

Brendan


1 Comment
Brendan Vanous said on Wed, 29 April 2015 at 5:05 PM

Thanks Julian!

Attributes are defined at the Catalog level right now, but we're working on an update which will add attributes to the Inventory as well, which should provide what you need. If this is a key need for your title, please do drop us a note at devrel@playfab.com to let us know, so that we can confirm whether our schedules align.

Brendan

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

brendan avatar image
brendan answered

Quick follow-up: You can add custom data to inventory item instances using the UpdateUserInventoryItemCustomData API method: https://api.playfab.com/Documentation/Server/method/UpdateUserInventoryItemCustomData. Combined with catalog data, which is globally defined for all items across all players, this allows you to have data which is specific to the item a particular player has, in order to provide things like item level, durability, etc.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.