Skip to main content

RecipePlugin.PreCraftState

Declaration#

public virtual void PreCraftState(GDTKRecipe recipe, Boolean& complete)

Parameters#

NameDescription
recipeRecipe crafted
completeReferenced value that must be true when action is completed

Description#

Perform actions before starting to craft

Usage#

using NullSave.GDTK.Inventory;using System.Collections;using UnityEngine;
public class Example : MonoBehaviour{
    public void ExampleMethod(GDTKRecipe target)    {        StartCoroutine(HandlePlugins(target));    }
    private IEnumerator HandlePlugins(GDTKRecipe target)    {        bool complete = false;        foreach (RecipePlugin plugin in target.plugins)        {            complete = true;            plugin.PreCraftState(target, ref complete);            while(!complete)            {                yield return new WaitForEndOfFrame();            }        }    }
}