static void Postfix(FiltrationMachine __instance) { if (__instance.GetComponent <StorageConnectable>() != null) { MonoBehaviour.DestroyImmediate(__instance.GetComponent <StorageConnectable>()); } }
internal static void Postfix(FiltrationMachine __instance) { if (Main.Instance != null) { Main.Instance.onFilterFastChanged.Trigger((bool)__instance.GetPrivateField("fastFiltering")); } }
static void Prefix(FiltrationMachine __instance) { if (__instance.gameObject.GetComponent <FiltrationMachineToggle>() == null) { __instance.gameObject.AddComponent <FiltrationMachineToggle>(); Logger.Log("Added FiltrationMachineToggle component to FiltrationMachine!"); } }
private void Init() { geo = GetComponentInParent <BaseFiltrationMachineGeometry>(); machine = (FiltrationMachine)GetModuleMethod.Invoke(geo, new object[] { }); identifier = machine.GetComponent <PrefabIdentifier>(); id = identifier.Id; toggle = machine.GetComponent <FiltrationMachineToggle>(); initialized = true; }
private static void Postfix(FiltrationMachine __instance) { int maxSalt = Main.config.FiltrationSalt; int maxWater = Main.config.FiltrationWater; Vector2int newContainerSize = new Vector2int(Main.config.FiltrationWidth, Main.config.FiltrationHeight); #if !RELEASE Logger.Log(Logger.Level.Debug, $"Reconfiguring Filtration Machine {__instance.gameObject.name} with configuration values of: maxSalt {maxSalt}, maxWater {maxWater}, new size ({newContainerSize.x}, {newContainerSize.y})"); #endif __instance.maxSalt = maxSalt; __instance.maxWater = maxWater; __instance.storageContainer.Resize(newContainerSize.x, newContainerSize.y); }
public void Initialize() { filtrationMachine = GetComponent <FiltrationMachine>(); geo = (BaseFiltrationMachineGeometry)GetModelMethod.Invoke(filtrationMachine, new object[] { }); identifier = GetComponentInParent <PrefabIdentifier>(); id = identifier.Id; OnLoad(); SetFiltrationMachineToggle(isOn); initialized = true; }
private static void Postfix(FiltrationMachine __instance) { __instance.maxSalt = Mod.config.FiltrationMachine.maxSalt; __instance.maxWater = Mod.config.FiltrationMachine.maxWater; __instance.storageContainer.Resize(Mod.config.FiltrationMachine.width, Mod.config.FiltrationMachine.height); }
public FiltrationMachinePowerConsumerInfo(FiltrationMachine filter) : base(filter.name) { this.filter = filter; }