Class FabricatorGadget
Represents a craft tree/fabricator gadget.
public class FabricatorGadget : Gadget
- Inheritance
-
FabricatorGadget
- Inherited Members
- Extension Methods
Constructors
FabricatorGadget(ICustomPrefab)
Constructs a fabricator gadget.
public FabricatorGadget(ICustomPrefab prefab)
Parameters
prefabICustomPrefab- The custom prefab to operate on.
Properties
CraftTreeType
The ID value for your custom craft tree.
public CraftTree.Type CraftTreeType { get; }
Property Value
- CraftTree.Type
Root
The root node of the crafting tree.
public ModCraftTreeRoot Root { get; }
Property Value
Methods
AddCraftNode(string, string)
Safely attempts to add a new crafting node to the custom crafting tree of this fabricator.
If the modded TechType is not found, the craft node will not be added.
public FabricatorGadget AddCraftNode(string moddedTechType, string parentTabId = null)
Parameters
moddedTechTypestring- The modded item to craft.
parentTabIdstring- Optional. The parent tab of this craft node. When this value is null, the craft node will be added to the root of the craft tree.
Returns
AddCraftNode(TechType, string)
Adds a new crafting node to the custom crafting tree of this fabricator.
public FabricatorGadget AddCraftNode(TechType techType, string parentTabId = null)
Parameters
techTypeTechType- The item to craft.
parentTabIdstring- Optional. The parent tab of this craft node. When this value is null, the craft node will be added to the root of the craft tree.
Returns
AddTabNode(string, string, Sprite, string, string)
Adds a new tab node to the custom crafting tree of this fabricator.
public FabricatorGadget AddTabNode(string tabId, string displayText, Sprite tabIcon, string language = "English", string parentTabId = null)
Parameters
tabIdstring- The internal ID for the tab node.
displayTextstring- The in-game text shown for the tab node. If null or empty, this will use the language line "{CraftTreeTypeName}_{
tabId}" instead. tabIconSprite- The sprite used for the tab node.
languagestring- The language for the display name. Defaults to English.
parentTabIdstring- Optional. The parent tab of this tab. When this value is null, the tab will be added to the root of the craft tree.
Returns
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()