Class CraftingGadget
Represents a crafting gadget
public class CraftingGadget : Gadget
- Inheritance
-
CraftingGadget
- Inherited Members
- Extension Methods
Constructors
CraftingGadget(ICustomPrefab, RecipeData)
Constructs a crafting gadget.
public CraftingGadget(ICustomPrefab prefab, RecipeData recipeData)
Parameters
prefab
ICustomPrefab- The custom prefab to operate on.
recipeData
RecipeData- The crafting recipe to add.
Properties
CraftingTime
The amount of seconds it takes to craft this item.
Values equal to or less than zero will be ignored.
public float CraftingTime { get; set; }
Property Value
FabricatorType
Craft Tree this node will appear in.
public CraftTree.Type FabricatorType { get; set; }
Property Value
- CraftTree.Type
RecipeData
The crafting recipe to add.
public required RecipeData RecipeData { get; set; }
Property Value
StepsToFabricatorTab
The steps to get to a tab you want this node to appear in.
If null or empty, it will instead appear at the craft tree's root.
If null or empty, it will instead appear at the craft tree's root.
public string[] StepsToFabricatorTab { get; set; }
Property Value
- string[]
Methods
Build()
Where the data actually gets registered to the game.
This is called after prefab register and PostRegisters in Register().
This is called after prefab register and PostRegisters in Register().
protected override void Build()
WithCraftingTime(float)
The amount of seconds it takes to craft this item.
Values equal to or less than zero will be ignored.
public CraftingGadget WithCraftingTime(float craftingTime)
Parameters
craftingTime
float- Amount of seconds
Returns
- CraftingGadget
- A reference to this instance after the operation has completed.
WithFabricatorType(Type)
Adds this prefab to a CraftTree type.
public CraftingGadget WithFabricatorType(CraftTree.Type fabricatorType)
Parameters
fabricatorType
CraftTree.Type- The craft tree type to add this crafting node to.
Returns
- CraftingGadget
- A reference to this instance after the operation has completed.
WithStepsToFabricatorTab(params string[])
Adds this node to a specific tab you want it to appear in.
public CraftingGadget WithStepsToFabricatorTab(params string[] stepsToFabricator)
Parameters
stepsToFabricator
string[]- The steps required to get to the tab in question. See https://subnauticamodding.github.io/Nautilus/tutorials/craft-tree-paths.html or the CraftTreeHandler.Paths class for examples of valid parameters.
If null, it will appear at the craft tree's root.
Returns
- CraftingGadget
- A reference to this instance after the operation has completed.