// Need to know when we have grabbed a Locomotive Remote // Actual Grab Handlers static void OnItemGrabbedRight(InventoryItemSpec iis) { LocomotiveRemoteController lrc = iis?.GetComponent <LocomotiveRemoteController>(); if (lrc != null) { LocoControllerBase locoController = (LocoControllerBase)typeof(LocomotiveRemoteController).GetField("pairedLocomotive", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(lrc); remoteCar = locoController?.GetComponent <TrainCar>(); } }
static void OnItemUngrabbedRight() { HoldingLocoRoCo = null; }
static bool Prefix(ref LocomotiveRemoteController __instance) { __instance.battery = 1f; __instance.batteryBar.UpdateValue(__instance.battery); return(false); }
// Need to know when we have grabbed a Locomotive Remote // Actual Grab Handlers static void OnItemGrabbedRight(InventoryItemSpec iis) { HoldingLocoRoCo = iis?.GetComponent <LocomotiveRemoteController>(); }