Table of Contents

Class GadgetExtensions

Namespace
Nautilus.Assets.Gadgets
Assembly
Nautilus.dll
Represents extension methods for the Gadget class.
public static class GadgetExtensions
Inheritance
GadgetExtensions
Inherited Members

Methods

CreateCreatureEgg(ICustomPrefab, int)

Makes this item have additional creature-egg-related functionality.
public static EggGadget CreateCreatureEgg(this ICustomPrefab customPrefab, int requiredAcuSize = 1)

Parameters

customPrefab ICustomPrefab
The custom prefab the creature egg gadget is created for.
requiredAcuSize int
The total amount of ACU floors required for the egg to be dropped in the ACU. This value is shared between the normal and the large ACU.

Returns

EggGadget
A reference to the created EggGadget instance after the operation has completed.

CreateFabricator(ICustomPrefab, out Type)

Creates a craft tree for this prefab. The created craft tree is immediately returned after this method is executed.
public static FabricatorGadget CreateFabricator(this ICustomPrefab customPrefab, out CraftTree.Type treeType)

Parameters

customPrefab ICustomPrefab
The custom prefab to set equipment slot for.
treeType CraftTree.Type
The created custom craft tree type.

Returns

FabricatorGadget
A reference to the created FabricatorGadget to continue the fabricator settings on.

CreateFragment(ICustomPrefab, TechType, float, int, string, bool, bool)

Makes this prefab a fragment.
public static ScanningGadget CreateFragment(this ICustomPrefab customPrefab, TechType blueprint, float scanTime, int fragmentsToScan = 1, string encyKey = null, bool destroyAfterScan = true, bool isFragment = true)

Parameters

customPrefab ICustomPrefab
The fragment custom prefab.
blueprint TechType
The blueprint that gets unlocked once this item is scanned
scanTime float
The amount of seconds it takes to scan this item.
fragmentsToScan int
The amount of fragments required to be scanned before the blueprint is unlocked.
encyKey string
The encyclopedia key to unlock once the scanning is completed.
destroyAfterScan bool
Should this object be destroyed after a successful scan?
isFragment bool
If this is set to , the loot distribution will not bother spawning this fragment if the blueprint is already unlocked.
This is the default behaviour for almost all of the vanilla fragments.

Returns

ScanningGadget
A reference to the created ScanningGadget to continue the scanning settings on.

SetEquipment(ICustomPrefab, EquipmentType)

Sets the type of equipment slot this item can fit into.
public static EquipmentGadget SetEquipment(this ICustomPrefab customPrefab, EquipmentType equipmentType)

Parameters

customPrefab ICustomPrefab
The custom prefab to set equipment slot for.
equipmentType EquipmentType
The type of equipment slot this item can fit into.

Returns

EquipmentGadget
A reference to the created EquipmentGadget to continue the equipment settings on.

SetPdaGroupCategory(ICustomPrefab, TechGroup, TechCategory)

Adds this item into a blueprint category to appear in.
public static ScanningGadget SetPdaGroupCategory(this ICustomPrefab customPrefab, TechGroup group, TechCategory category)

Parameters

customPrefab ICustomPrefab
The custom prefab to add unlocks to.
group TechGroup
The main group in the PDA blueprints where this item appears
category TechCategory
The category within the group in the PDA blueprints where this item appears.

Returns

ScanningGadget
A reference to the created ScanningGadget to continue the scanning settings on.

Remarks

If the specified group is a tech group that is present in the uGUI_BuilderMenu.groups list, this item will automatically become buildable. To avoid this, or make this item a buildable manually, use the SetBuildable(bool) method.

SetPdaGroupCategoryAfter(ICustomPrefab, TechGroup, TechCategory, TechType)

Adds this item into a blueprint category to appear in.
public static ScanningGadget SetPdaGroupCategoryAfter(this ICustomPrefab customPrefab, TechGroup group, TechCategory category, TechType target)

Parameters

customPrefab ICustomPrefab
The custom prefab to add unlocks to.
group TechGroup
The main group in the PDA blueprints where this item appears.
category TechCategory
The category within the group in the PDA blueprints where this item appears.
target TechType
It will be added after this target item or at the end if not found.

Returns

ScanningGadget
A reference to the created ScanningGadget to continue the scanning settings on.

Remarks

If the specified group is a tech group that is present in the uGUI_BuilderMenu.groups list, this item will automatically become buildable. To avoid this, or make this item a buildable manually, use the SetBuildable(bool) method.

SetPdaGroupCategoryBefore(ICustomPrefab, TechGroup, TechCategory, TechType)

Adds this item into a blueprint category to appear in.
public static ScanningGadget SetPdaGroupCategoryBefore(this ICustomPrefab customPrefab, TechGroup group, TechCategory category, TechType target)

Parameters

customPrefab ICustomPrefab
The custom prefab to add unlocks to.
group TechGroup
The main group in the PDA blueprints where this item appears.
category TechCategory
The category within the group in the PDA blueprints where this item appears.
target TechType
It will be inserted before this target item or at the beginning if not found.

Returns

ScanningGadget
A reference to the created ScanningGadget to continue the scanning settings on.

Remarks

If the specified group is a tech group that is present in the uGUI_BuilderMenu.groups list, this item will automatically become buildable. To avoid this, or make this item a buildable manually, use the SetBuildable(bool) method.

SetRecipe(ICustomPrefab, RecipeData)

Adds recipe to this custom prefab.
public static CraftingGadget SetRecipe(this ICustomPrefab customPrefab, RecipeData recipeData)

Parameters

customPrefab ICustomPrefab
The custom prefab to add recipe to.
recipeData RecipeData
The recipe to add.

Returns

CraftingGadget
A reference to the created CraftingGadget to continue the recipe settings on.

SetRecipeFromJson(ICustomPrefab, string)

Adds recipe from a json file to this custom prefab.
public static CraftingGadget SetRecipeFromJson(this ICustomPrefab customPrefab, string filePath)

Parameters

customPrefab ICustomPrefab
The custom prefab to add recipe to.
filePath string
The path to the recipe json file. A string with valid recipe data json is also acceptable.

Returns

CraftingGadget
A reference to the created CraftingGadget to continue the recipe settings on.

SetSpawns(ICustomPrefab, params BiomeData[])

Adds biome spawns for this custom prefab with default UWE.WorldEntityInfo values.
public static ICustomPrefab SetSpawns(this ICustomPrefab customPrefab, params LootDistributionData.BiomeData[] biomesToSpawnIn)

Parameters

customPrefab ICustomPrefab
The custom prefab to add biome spawns for.
biomesToSpawnIn BiomeData[]
The biomes to spawn in.

Returns

ICustomPrefab
A reference to this instance after the operation has completed.

SetSpawns(ICustomPrefab, params SpawnLocation[])

Adds coordinated spawns for this custom prefab.
public static ICustomPrefab SetSpawns(this ICustomPrefab customPrefab, params SpawnLocation[] spawnLocations)

Parameters

customPrefab ICustomPrefab
The custom prefab to add coordinated spawns for.
spawnLocations SpawnLocation[]
The spawn locations to spawn in.

Returns

ICustomPrefab
A reference to this instance after the operation has completed.

SetSpawns(ICustomPrefab, WorldEntityInfo, params BiomeData[])

Adds biome spawns for this custom prefab.
public static ICustomPrefab SetSpawns(this ICustomPrefab customPrefab, WorldEntityInfo entityInfo, params LootDistributionData.BiomeData[] biomesToSpawnIn)

Parameters

customPrefab ICustomPrefab
The custom prefab to add biome spawns for.
entityInfo WorldEntityInfo
Data on how the biome spawner should treat this object as.
biomesToSpawnIn BiomeData[]
The biomes to spawn in.

Returns

ICustomPrefab
A reference to this instance after the operation has completed.

SetUnlock(ICustomPrefab, TechType, int)

Adds unlocks to this custom prefab.
public static ScanningGadget SetUnlock(this ICustomPrefab customPrefab, TechType requiredForUnlock, int fragmentsToScan = 1)

Parameters

customPrefab ICustomPrefab
The custom prefab to add unlocks to.
requiredForUnlock TechType
The blueprint to set as a requirement.
fragmentsToScan int
Amount of requiredForUnlock that must be scanned to unlock this item.

Returns

ScanningGadget
A reference to the created ScanningGadget to continue the scanning settings on.

SetVehicleUpgradeModule(ICustomPrefab, EquipmentType, QuickSlotType)

Sets this item as a vehicle upgrade module. Cyclops upgrades are not supported by this function.

If you're using this function, please do not use SetEquipment(ICustomPrefab, EquipmentType),
it would interfere with this and possibly make the game crash or cause the mod to not work.

public static UpgradeModuleGadget SetVehicleUpgradeModule(this ICustomPrefab customPrefab, EquipmentType equipmentType = EquipmentType.VehicleModule, QuickSlotType slotType = QuickSlotType.Passive)

Parameters

customPrefab ICustomPrefab
The custom prefab to set vehicle upgrade for.
equipmentType EquipmentType
The type of equipment slot this item can fit into. Preferably use something related to vehicles.
slotType QuickSlotType
The quick slot type

Returns

UpgradeModuleGadget
A reference to the created UpgradeModuleGadget to continue the upgrade settings on.