/// <summary> /// Applied after OnSpawn runs. /// </summary> internal static void Postfix(SolidTransferArm __instance) { if (__instance != null && __instance.TryGetComponent(out Storage storage)) { storage.SetDefaultStoredItemModifiers(Storage.StandardSealedStorage); } }
/// <summary> /// Applied after OnSpawn runs. /// </summary> internal static void Postfix(SolidTransferArm __instance) { Storage storage; if (__instance != null && (storage = __instance.GetComponent <Storage>()) != null) { storage.SetDefaultStoredItemModifiers(Storage.StandardSealedStorage); } }
public SolidTransferArmInfo(SolidTransferArm sweeper) { if (sweeper == null) { throw new ArgumentNullException(nameof(sweeper)); } var go = sweeper.gameObject; gameObject = go; cell = Grid.PosToCell(sweeper.transform.position); refreshedCells = false; this.sweeper = sweeper; }
public ChoreConsumerState(ChoreConsumer consumer) { this.consumer = consumer; navigator = consumer.GetComponent <Navigator>(); prefabid = consumer.GetComponent <KPrefabID>(); ownable = consumer.GetComponent <Ownable>(); gameObject = consumer.gameObject; solidTransferArm = consumer.GetComponent <SolidTransferArm>(); hasSolidTransferArm = ((Object)solidTransferArm != (Object)null); resume = consumer.GetComponent <MinionResume>(); choreDriver = consumer.GetComponent <ChoreDriver>(); schedulable = consumer.GetComponent <Schedulable>(); traits = consumer.GetComponent <Traits>(); choreProvider = consumer.GetComponent <ChoreProvider>(); MinionIdentity component = consumer.GetComponent <MinionIdentity>(); if ((Object)component != (Object)null) { if (component.assignableProxy == null) { component.assignableProxy = MinionAssignablesProxy.InitAssignableProxy(component.assignableProxy, component); } assignables = component.GetSoleOwner(); equipment = component.GetEquipment(); } else { assignables = consumer.GetComponent <Assignables>(); equipment = consumer.GetComponent <Equipment>(); } storage = consumer.GetComponent <Storage>(); consumableConsumer = consumer.GetComponent <ConsumableConsumer>(); worker = consumer.GetComponent <Worker>(); selectable = consumer.GetComponent <KSelectable>(); if ((Object)schedulable != (Object)null) { int blockIdx = Schedule.GetBlockIdx(); scheduleBlock = schedulable.GetSchedule().GetBlock(blockIdx); } }
protected override void OnCleanUp() { visualizer = null; transferArm = null; base.OnCleanUp(); }