public void mainMenu() { Time.timeScale = 1.0f; sound.setMusicInstruments(-1f); sound.stopRainSound(); SceneManager.LoadScene(0); }
private void OnControllerColliderHit(ControllerColliderHit hit) { int shape = shapeCh.getShape(); string tag; switch (shape) { case 0: tag = "Cube"; brWallSpawn = brWallCube; break; case 1: tag = "Sphere"; brWallSpawn = brWallSphere; break; case 2: tag = "Triangle"; brWallSpawn = brWallTriangle; break; default: tag = "Error"; break; } if (hit.gameObject.CompareTag(tag)) { points.points++; Destroy(hit.gameObject); sound.setWallPitch(points.points); sound.playWallHit(); sound.playPickup(); switch (points.points) { case 25: case 35: case 55: case 99: case 150: sound.setAnnouncerVoiceline(points.points); sound.playAnnouncer(); break; case 24: sound.setMusicInstruments(0.5f); break; case 34: sound.setMusicInstruments(0.7f); break; case 54: sound.setMusicInstruments(1f); break; } GameObject brWall = Instantiate(brWallSpawn); brWall.transform.position = gameObject.transform.position; StartCoroutine(waitToKill(brWall)); } else if (!hit.gameObject.CompareTag(tag) || hit.gameObject.Equals("Wall")) { killPlayer(); } else { } }