public static void Map(GameObject prefab) { if (prefab is null) { throw new ArgumentException("The prefab was NULL."); } ModComponent modComponent = ComponentUtils.GetModComponent(prefab); if (modComponent is null) { throw new ArgumentException("Prefab " + prefab.name + " does not contain a ModComponent."); } bool hasModPlaceHolder = !(ComponentUtils.GetComponent <ModPlaceHolderComponent>(prefab) is null); if (prefab.GetComponent <GearItem>() is null || hasModPlaceHolder) { ConfigureBehaviours(modComponent); EquippableMapper.Configure(modComponent); LiquidMapper.Configure(modComponent); PowderMapper.Configure(modComponent); FoodMapper.Configure(modComponent); CookableMapper.Configure(modComponent); CookingPotMapper.Configure(modComponent); RifleMapper.Configure(modComponent); ClothingMapper.Configure(modComponent); CollectibleMapper.Configure(modComponent); CharcoalMapper.Configure(modComponent); PurificationMapper.Configure(modComponent); ResearchMapper.Configure(modComponent); FirstAidMapper.Configure(modComponent); ToolMapper.Configure(modComponent); GenericEquippableMapper.Configure(modComponent); BedMapper.Configure(modComponent); BodyHarvestMapper.Configure(modComponent); if (hasModPlaceHolder) { return; } InspectMapper.Configure(modComponent); ConfigureGearItem(modComponent); mappedItems.Add(modComponent); PostProcess(modComponent); } }
public static MappedItem Map(GameObject prefab) { if (prefab == null) { throw new ArgumentException("The prefab was NULL."); } ModComponent modComponent = ModUtils.GetModComponent(prefab); if (modComponent == null) { throw new ArgumentException("Prefab " + prefab.name + " does not contain a ModComponent."); } if (prefab.GetComponent <GearItem>() == null) { Implementation.Log("Mapping {0}", prefab.name); InspectMapper.Configure(modComponent); HarvestableMapper.Configure(modComponent); RepairableMapper.Configure(modComponent); FireStarterMapper.Configure(modComponent); ConfigureAccelerant(modComponent); ConfigureStackable(modComponent); ConfigureBurnable(modComponent); ScentMapper.Configure(modComponent); SharpenableMapper.Configure(modComponent); EvolveMapper.Configure(modComponent); ConfigureEquippable(modComponent); ConfigureLiquidItem(modComponent); ConfigureFood(modComponent); CookableMapper.Configure(modComponent); ConfigureCookingPot(modComponent); ConfigureRifle(modComponent); ClothingMapper.ConfigureClothing(modComponent); FirstAidMapper.Configure(modComponent); ToolMapper.Configure(modComponent); BedMapper.Configure(modComponent); ConfigureGearItem(modComponent); mappedItems.Add(modComponent); PostProcess(modComponent); } return(new MappedItem(prefab)); }