Exemple #1
0
        /// <summary>
        /// <para>Triggers the indicated generator to drop and item if available.</para>
        /// <para>NOTE: This will trigger an Items Droped event and optionally a Refresh of the player's inventory</para>
        /// </summary>
        /// <param name="generator"></param>
        /// <param name="postDropRefresh"></param>
        public void TriggerItemDrop(ItemGeneratorDefinition generator, bool postDropRefresh)
        {
            generator.TriggerDrop((status, results) =>
            {
                if (status)
                {
                    if (LogDebugMessages)
                    {
                        Debug.Log("Item Drop for [" + generator.name + "] completed with status " + status + " and " + results.Count() + " instances effected.");
                    }
                    if (postDropRefresh)
                    {
                        RefreshInventory();
                    }
                }

                ItemsDroped.Invoke(status, results);
            });
        }
Exemple #2
0
 public void TriggerItemDropAndRefresh(ItemGeneratorDefinition generator)
 {
     TriggerItemDrop(generator, true);
 }
Exemple #3
0
 public void TriggerItemDrop(ItemGeneratorDefinition generator)
 {
     TriggerItemDrop(generator, false);
 }
Exemple #4
0
 /// <summary>
 /// <para>Triggers the indicated generator to drop and item if available.</para>
 /// <para>NOTE: This will trigger an Items Droped event and optionally a Refresh of the player's inventory</para>
 /// </summary>
 /// <param name="generator"></param>
 /// <param name="postDropRefresh"></param>
 public void TriggerItemDrop(ItemGeneratorDefinition generator, bool postDropRefresh = false)
 {
     Settings.TriggerItemDrop(generator, postDropRefresh);
 }