Class GadgetExtensions
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
- customPrefabICustomPrefab
- The custom prefab the creature egg gadget is created for.
- requiredAcuSizeint
- 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
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
- customPrefabICustomPrefab
- The custom prefab to set equipment slot for.
- treeTypeCraftTree.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
- customPrefabICustomPrefab
- The fragment custom prefab.
- blueprintTechType
- The blueprint that gets unlocked once this item is scanned
- scanTimefloat
- The amount of seconds it takes to scan this item.
- fragmentsToScanint
- The amount of fragments required to be scanned before the blueprint is unlocked.
- encyKeystring
- The encyclopedia key to unlock once the scanning is completed.
- destroyAfterScanbool
- Should this object be destroyed after a successful scan?
- isFragmentbool
- 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
- customPrefabICustomPrefab
- The custom prefab to set equipment slot for.
- equipmentTypeEquipmentType
- 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
- customPrefabICustomPrefab
- The custom prefab to add unlocks to.
- groupTechGroup
- The main group in the PDA blueprints where this item appears
- categoryTechCategory
- 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
- customPrefabICustomPrefab
- The custom prefab to add unlocks to.
- groupTechGroup
- The main group in the PDA blueprints where this item appears.
- categoryTechCategory
- The category within the group in the PDA blueprints where this item appears.
- targetTechType
- 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
- customPrefabICustomPrefab
- The custom prefab to add unlocks to.
- groupTechGroup
- The main group in the PDA blueprints where this item appears.
- categoryTechCategory
- The category within the group in the PDA blueprints where this item appears.
- targetTechType
- 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
- customPrefabICustomPrefab
- The custom prefab to add recipe to.
- recipeDataRecipeData
- 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
- customPrefabICustomPrefab
- The custom prefab to add recipe to.
- filePathstring
- 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
- customPrefabICustomPrefab
- The custom prefab to add biome spawns for.
- biomesToSpawnInBiomeData[]
- 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
- customPrefabICustomPrefab
- The custom prefab to add coordinated spawns for.
- spawnLocationsSpawnLocation[]
- 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
- customPrefabICustomPrefab
- The custom prefab to add biome spawns for.
- entityInfoWorldEntityInfo
- Data on how the biome spawner should treat this object as.
- biomesToSpawnInBiomeData[]
- 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
- customPrefabICustomPrefab
- The custom prefab to add unlocks to.
- requiredForUnlockTechType
- The blueprint to set as a requirement.
- fragmentsToScanint
- Amount of requiredForUnlockthat 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
- customPrefabICustomPrefab
- The custom prefab to set vehicle upgrade for.
- equipmentTypeEquipmentType
- The type of equipment slot this item can fit into. Preferably use something related to vehicles.
- slotTypeQuickSlotType
- The quick slot type
Returns
- UpgradeModuleGadget
- A reference to the created UpgradeModuleGadget to continue the upgrade settings on.