コード例 #1
0
    public override void ConfigureBuildingTemplate(GameObject go, Tag prefab_tag)
    {
        go.GetComponent <KPrefabID>().AddTag(RoomConstraints.ConstraintTags.IndustrialMachinery, false);
        OreScrubber oreScrubber = go.AddOrGet <OreScrubber>();

        oreScrubber.massConsumedPerUse  = 0.07f;
        oreScrubber.consumedElement     = SimHashes.ChlorineGas;
        oreScrubber.diseaseRemovalCount = 480000;
        ConduitConsumer conduitConsumer = go.AddOrGet <ConduitConsumer>();

        conduitConsumer.conduitType        = ConduitType.Liquid;
        conduitConsumer.consumptionRate    = 1f;
        conduitConsumer.capacityKG         = 10f;
        conduitConsumer.wrongElementResult = ConduitConsumer.WrongElementResult.Dump;
        conduitConsumer.capacityTag        = ElementLoader.FindElementByHash(SimHashes.ChlorineGas).tag;
        go.AddOrGet <DirectionControl>();
        OreScrubber.Work work = go.AddOrGet <OreScrubber.Work>();
        work.overrideAnims = new KAnimFile[1]
        {
            Assets.GetAnim("anim_interacts_ore_scrubber_kanim")
        };
        work.workTime  = 10.2f;
        work.trackUses = true;
        work.workLayer = Grid.SceneLayer.BuildingUse;
        Storage storage = go.AddOrGet <Storage>();

        storage.SetDefaultStoredItemModifiers(Storage.StandardSealedStorage);
    }
コード例 #2
0
 /// <summary>
 /// Applied after OnPrefabInit runs.
 /// </summary>
 internal static void Postfix(OreScrubber.Work __instance)
 {
     __instance.gameObject?.AddComponent <ScrubberCheckpoint>();
 }
コード例 #3
0
 /// <summary>
 /// Applied after OnPrefabInit runs.
 /// </summary>
 internal static void Postfix(OreScrubber.Work __instance)
 {
     __instance.gameObject.AddOrGet <ScrubberCheckpoint>();
 }