Example #1
0
        public static void ConsumeItemCallback(ConsumeItemResult consumeResult)
        {
            string characterId = ((ConsumeItemRequest)consumeResult.Request).CharacterId;

            if (consumeResult.RemainingUses == 0)
            {
                PfSharedModelEx.globalClientUser.RemoveItems(characterId, new HashSet <string>()
                {
                    consumeResult.ItemInstanceId
                });
            }
            else
            {
                PfSharedModelEx.globalClientUser.UpdateRemainingUses(characterId, consumeResult.ItemInstanceId, consumeResult.RemainingUses);
            }

            PfSharedModelEx.globalClientUser.UpdateInvDisplay(PfSharedControllerEx.Api.Client);
            PfSharedControllerEx.PostEventMessage(PfSharedControllerEx.EventType.OnInventoryChanged, PfSharedModelEx.globalClientUser.playFabId, characterId, PfSharedControllerEx.Api.Client | PfSharedControllerEx.Api.Server, false);
        }
Example #2
0
        public void ConsumeItemCallback(ConsumeItemResult consumeResult)
        {
            if (consumeResult.RemainingUses == 0)
            {
                PfSharedModelEx.globalClientUser.RemoveItems(characterId, new HashSet <string>()
                {
                    consumeResult.ItemInstanceId
                });
            }
            else
            {
                PfSharedModelEx.globalClientUser.UpdateRemainingUses(characterId, consumeResult.ItemInstanceId, consumeResult.RemainingUses);
            }

            CharacterModel tempModel;

            if (PfSharedModelEx.globalClientUser.clientCharacterModels.TryGetValue(characterId, out tempModel))
            {
                tempModel.UpdateInvDisplay();
            }

            PfSharedControllerEx.PostEventMessage(PfSharedControllerEx.EventType.OnInventoryChanged, PfSharedModelEx.globalClientUser.playFabId, characterId, PfSharedControllerEx.Api.Client | PfSharedControllerEx.Api.Server, false);
        }
 /// <summary>
 /// Callback called when user successfully consumes a bought item.
 /// </summary>
 /// <param name="result">Result.</param>
 void OnConsumeItemSuccess(ConsumeItemResult result)
 {
     Debug.Log("successfully consumed item");
 }
Example #4
0
 private void onConsumeCompleted(ConsumeItemResult result)
 {
     Debug.Log("Consumed.");
 }
Example #5
0
 /**
  * Calls success.
  */
 private void OnConsumeSuccess(ConsumeItemResult result)
 {
     m_request.OnSuccess();
 }
 void OnItemConsumed(ConsumeItemResult result)
 {
     //Do some kind of feedback stuff
 }