OnCraft() public method

public OnCraft ( Item item ) : void
item Item
return void
示例#1
0
        /// <summary>
        /// Allows you to make anything happen when a player uses this recipe.
        /// </summary>
        /// <param name="item">The item crafted.</param>
        /// <param name="recipe">The recipe used to craft the item.</param>
        public static void OnCraft(Item item, Recipe recipe)
        {
            ModRecipe modRecipe = recipe as ModRecipe;

            if (modRecipe != null)
            {
                modRecipe.OnCraft(item);
            }
            foreach (GlobalRecipe globalRecipe in globalRecipes)
            {
                globalRecipe.OnCraft(item, recipe);
            }
        }