private void nextLevel() { float t = GameObject.FindGameObjectWithTag("MainCamera").GetComponent<AudioSource>().time; pdc.menuMusicTime = t; var ll = new LoadLevel(); foreach(var score in pdc.scores){ if(score.score == 5){ Application.LoadLevel("Podiums_Set_02"); return; } } Application.LoadLevel(ll.GetRandomLevel()); }
// Update is called once per frame void Update() { if(Input.GetKey("joystick 1 button 0")){ if(P1_PressA.renderer.enabled == true){ pcc.AddPlayer("1"); SelectSound.Play(); } P1_OK.renderer.enabled = true; P1_PressA.renderer.enabled = false; } if(Input.GetKey("joystick 2 button 0")){ if(P2_PressA.renderer.enabled == true){ pcc.AddPlayer("2"); SelectSound.Play(); } P2_OK.renderer.enabled = true; P2_PressA.renderer.enabled = false; } if(Input.GetKey("joystick 3 button 0")){ if(P3_PressA.renderer.enabled == true){ pcc.AddPlayer("3"); SelectSound.Play(); } P3_OK.renderer.enabled = true; P3_PressA.renderer.enabled = false; } if(Input.GetKey("joystick 4 button 0")){ if(P4_PressA.renderer.enabled == true){ pcc.AddPlayer("4"); SelectSound.Play(); } P4_OK.renderer.enabled = true; P4_PressA.renderer.enabled = false; } for(int i = 1; i < 5; i++){ if(Input.GetKey("joystick " + i.ToString() + " button 7")){ if(pcc.PlayerCount > 1){ DontDestroyOnLoad(pcc); var ll = new LoadLevel(); pcc.menuMusicTime = 0; Application.LoadLevel(ll.GetRandomLevel()); } } } }