I am new to this so I am trying to grasp the correct way to do this. I am trying to search through the player inventory for a specific item to get the InstanceId. Then use the InstanceId with the ConsumeItem command.
public void ConsumePotion() { PlayFabClientAPI.ConsumeItem(new ConsumeItemRequest { ConsumeCount = 1, // This is a hex-string value from the GetUserInventory result ItemInstanceId = "How do i get this Value?" }, LogSuccess, LogFailure); }
I can get the values but I don't know how to use them
public void GetInventory() { PlayFabClientAPI.GetUserInventory(new GetUserInventoryRequest(),OnGetInventory,error => Debug.LogError(error.GenerateErrorReport())); } public void OnGetInventory(GetUserInventoryResult result) { Debug.Log ("Received the following items:"); foreach (var eachItem in result.Inventory) { ItemIds.Add (eachItem.ItemId, eachItem.ItemInstanceId); string Instance = ItemIds [eachItem.ItemId]; Debug.Log(Instance); } }