public void SetMode(RoverModes newVehicleMode) { roverMode = newVehicleMode; if (roverMode == RoverModes.driving) { hasBeenDriven = true; GetComponent <Rigidbody> ().isKinematic = false; } DisableCameras(); }
private void OccupiedUpdate() { //forward and reverse currentThrust = 0.0f; float accelerationAxis = Input.GetAxis("Vertical"); if (accelerationAxis > deadZone) { currentThrust = accelerationAxis * forwardAcceleration; } else if (accelerationAxis < -deadZone) { currentThrust = accelerationAxis * backwardAcceleration; } //turning currentTurn = 0.0f; float turnAxis = Input.GetAxis("Horizontal"); if (Mathf.Abs(turnAxis) > deadZone) { currentTurn = turnAxis * turnStrength; } //other if (Input.GetKeyDown(KeyCode.M)) { NextCamera(); } if (Input.GetKey(KeyCode.Space)) { roverMode = RoverModes.braking; } else { roverMode = RoverModes.driving; } }