// ------------------------------------------------------------------------------------------------------ // // ------------------------- F I L E & D A T A M A N A G E M E N T ----------------------------------- // // ------------------------------------------------------------------------------------------------------ // void Update() { if (terrainManager.startTimer) { // The Current Block block = PlayerPrefs.GetInt("numberOfBlocks").ToString(); // Gets variables regarding difficulty difficulty = terrainManager.getCurrentDifficultyLevel().ToString(); timer = terrainManager.getTimer().ToString(); // Gets the current X,Y,Z coordinates where the car is driving currentXPos = carbehaviour.transform.position.x.ToString(); currentYPos = carbehaviour.transform.position.y.ToString(); currentZPos = carbehaviour.transform.position.z.ToString(); // Variables for points and passing cars correctly points = carbehaviour.getPoints().ToString(); currentlyPassingCar = carbehaviour.getCurrentlyPassingCar().ToString(); // Variables for when car is crashing totalCrashed = carbehaviour.getTimesCrashed().ToString(); currentlyCrashing = carbehaviour.getCurrentlyCrashing().ToString(); crashedX = carbehaviour.getCrashedX().ToString(); crashedY = carbehaviour.getCrashedY().ToString(); crashedZ = carbehaviour.getCrashedZ().ToString(); // Checks if the left/right keys are being pressed at that time if (Input.GetKeyDown(KeyCode.LeftArrow)) { leftArrowPressed = "1"; } if (Input.GetKeyUp(KeyCode.LeftArrow)) { leftArrowPressed = "0"; } if (Input.GetKeyDown(KeyCode.RightArrow)) { rightArrowPressed = "1"; } if (Input.GetKeyUp(KeyCode.RightArrow)) { rightArrowPressed = "0"; } saveCarSpawnedDetails("0", "0", "0", "0", "0"); } }