Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SteamInventoryResult_t myInventoryHandle;
- public static List<int> inventoryItemDefs;
- private Callback<SteamInventoryFullUpdate_t> updateResult;
- void Start () {
- //DEBUG_DestroyAllItems();
- inventoryItemDefs = new List<int> ();
- RefreshInventory ();
- //DEBUG_GrantTestItems ();
- }
- void RefreshInventory() {
- SteamInventory.GetAllItems (out myInventoryHandle);
- updateResult = Callback<SteamInventoryFullUpdate_t>.Create (OnInventoryFullUpdate);
- }
- void OnInventoryFullUpdate(SteamInventoryFullUpdate_t fullUpdate) {
- uint itemCount = 0;
- SteamItemDetails_t[] itemDetails;
- if (SteamInventory.GetResultItems (myInventoryHandle, null, ref itemCount)) {
- Debug.Log ("Item Count:" + itemCount);
- itemDetails = new SteamItemDetails_t[itemCount];
- SteamInventory.GetResultItems (myInventoryHandle, itemDetails, ref itemCount);
- foreach (SteamItemDetails_t itemDetail in itemDetails) {
- int itemDef = (int)itemDetail.m_iDefinition;
- inventoryItemDefs.Add (itemDef);
- //Debug.Log ("Item:" + itemDef);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement