// 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>();
            }
        }
Пример #2
0
        static void OnItemGrabbedRight(InventoryItemSpec iis)
        {
            if (iis == null)
            {
                return;
            }
            // mod.Logger.Log(string.Format("Picked up a(n) {0} in the right hand.", iis.itemName));
            JobOverview jo = iis.GetComponent <JobOverview>();

            if (jo != null)
            {
                holdingRight = new JobDispatch(jo.job);
                showing      = false;
            }
            else
            {
                JobBooklet jb = iis.GetComponent <JobBooklet>();
                if (jb != null)
                {
                    holdingRight = new JobDispatch(jb.job);
                    showing      = false;
                }
            }
        }
 // Need to know when we have grabbed a Locomotive Remote
 // Actual Grab Handlers
 static void OnItemGrabbedRight(InventoryItemSpec iis)
 {
     HoldingLocoRoCo = iis?.GetComponent <LocomotiveRemoteController>();
 }