示例#1
0
 /// <summary>
 /// Grants a copy of this item if available in the items definition on the Steam backend.
 /// </summary>
 public void GrantPromoItem()
 {
     SteamworksPlayerInventory.AddPromoItem(DefinitionID, (status, results) =>
     {
         if (SteamworksInventorySettings.Current != null)
         {
             SteamworksInventorySettings.Current.ItemsGranted.Invoke(status, results);
         }
     });
 }
示例#2
0
        /// <summary>
        /// <para>Grants the user a promotional item</para>
        /// <para>This will trigger the Item Instances Updated event after steam responds with the users inventory items and the items have been updated to reflect the correct instances.</para>
        /// <para> <para>
        /// <para>NOTE: this additivly updates the Instance list for effected items and is not a clean refresh!
        /// Consider a call to Refresh Inventory to resolve a complete and accurate refresh of all player items.</para>
        /// </summary>
        /// <paramref name="itemDefinition">The item type to grant to the user.</paramref>
        public void GrantPromotionalItem(InventoryItemDefinition itemDefinition)
        {
            var result = SteamworksPlayerInventory.AddPromoItem(itemDefinition.DefinitionID, (status, results) =>
            {
                ItemsGranted.Invoke(status, results);
            });

            if (!result)
            {
                Debug.LogWarning("[SteamworksInventorySettings.GrantPromotionalItem] - Call failed");
            }
        }