Esempio n. 1
0
 public void ToggleVehicle(VehicleParent newVP)
 {
     if (newVP == null)
     {
         vp.driverSeat.ToggleDriverMesh(false);
         vp.ExitVehicle();
         cam.target = playerController.transform;
         UnsmurfPlayer();
         cam.vel       = tpRagdoll.mainRB;
         cam.followVel = true;
         vp            = null;
         inVehicle     = false;
         LeanTween.move(vehicleUI, vehicleUIrestpos, 0.1f);
         LeanTween.move(inventoryAmmoUI, inventoryAmmoUIactivepos, 0.1f);
     }
     else
     {
         vp = newVP;
         vp.driverSeat.ToggleDriverMesh(true, playerMesh.material.mainTexture);
         vp.EnterVehicle();
         SmurfPlayer(vp.driverSeat.transform.position);
         gearbox = vp.gameObject.GetComponentInChildren <GearboxTransmission>();
         engine  = vp.gameObject.GetComponentInChildren <Motor>();
         trans   = vp.gameObject.GetComponentInChildren <Transmission>();
         //			trans.automatic = autoShiftToggle.isOn;
         cam.target    = vp.gameObject.transform;
         cam.vel       = vp.rb;
         cam.followVel = true;
         inVehicle     = true;
         LeanTween.move(vehicleUI, vehicleUIactivepos, 0.1f);
         LeanTween.move(inventoryAmmoUI, inventoryAmmoUIrestpos, 0.1f);
     }
 }