Accessing custom recipe variables through script

Code:
var craftingRecipeWithTime = craftingRecipe as CraftingRecipeWithTime;
if(craftingRecipeWithTime == null){ 
Debug.LogWarning("CraftingRecipe is not a crafting recipe with time");
return; 
}
var craftTime = craftingRecipeWithTime.CraftTime;

That's assuming you do have a public getter for craft time.
The null check is to make sure you don't have a recipe with another type.
 
Top