Exemple #1
0
 public void loadNewScene(string scene)
 {
     //change the time scale back to normal
     Time.timeScale = 1.0f;
     //playMusicAgain();
     LoadNewLevelAsync.LoadLevelAsyncNow(scene);
 }
Exemple #2
0
 // Update is called once per frame
 void Update()
 {
     //check if the user has their game data loaded before allowing them to press any button
     if (GameManager.Instance.hasDataLoaded == true)
     {
         //Check if there is any input so we can load the Main Menu
         if (Input.anyKey && hasPressedButton == false)
         {
             hasPressedButton = true;
             LoadNewLevelAsync.LoadLevelAsyncNow("MainMenu");
         }
     }
 }
Exemple #3
0
    private void restartLevel()
    {
        //set the time scale back to normal
        //Time.timeScale = 1.0f;

        //make the music start again
        GameObject _music = GameObject.Find("_Music");

        if (_music != null)
        {
            _music.GetComponent <musicControls>().musicPlay();
            Debug.Log("Starting Music Again");
        }


        //load the level again
        LoadNewLevelAsync.LoadLevelAsyncNow(Application.loadedLevelName);
    }