Ejemplo n.º 1
0
 public void ConsumeAnItem(string ItemId, int ConsumeAmount, InstancesOfAnItem InstanceId)
 {
     PlayFabClientAPI.ConsumeItem(new ConsumeItemRequest()
     {
         ItemInstanceId = InstanceId.instanceOfTheItem,
         ConsumeCount   = ConsumeAmount
     },
                                  (result) =>
     {
         result.RemainingUses = 1;
         Debug.Log("Item Consumed successfully.");
         ProfileManager.GetInstance.myInstancesOfItems.Remove(InstanceId); //removes from the instances
     },
                                  (error) =>
     {
         Debug.Log("failed to Consume the item: " + "itemId-" + ItemId + "consumeAmount= " + ConsumeAmount + "instanceId" + InstanceId + error.ErrorDetails + ErrorCallback.Combine());
     }
                                  );
 }