// Update is called once per frame void Update() { if (SceneManager.GetActiveScene().name == "gameOver") { if (Input.GetKeyDown("space")) { SceneManager.LoadScene(sceneName); } } else { currentScore += Time.deltaTime; scoreText.text = "SCORE : " + Mathf.Round(currentScore * 100) * 0.01f; if (player.DeadStatus()) { if (maxScore <= currentScore) { maxScore = currentScore; } PlayerPrefs.SetFloat("current", currentScore); PlayerPrefs.SetFloat("max", maxScore); SceneManager.LoadScene(sceneName); } } }