LoadScene() public méthode

public LoadScene ( ) : void
Résultat void
Exemple #1
0
    public void StartButtonClicked()
    {
//		//If changeMusicOnStart is true, fade out volume of music group of AudioMixer by calling FadeDown function of PlayMusic, using length of fadeColorAnimationClip as time.
//		//To change fade time, change length of animation "FadeToColor"
//		if (changeMusicOnStart)
//		{
//			playMusic.FadeDown(fadeColorAnimationClip.length);
//		}
//
//		//If changeScenes is true, start fading and change scenes halfway through animation when screen is blocked by FadeImage
//		if (changeScenes)
//		{
//			//Use invoke to delay calling of LoadDelayed by half the length of fadeColorAnimationClip
//			Invoke ("LoadDelayed", fadeColorAnimationClip.length * .5f);
//
//			//Set the trigger of Animator animColorFade to start transition to the FadeToOpaque state.
//			//animColorFade.SetTrigger ("fade");
//		}
//
//		//If changeScenes is false, call StartGameInScene
//		else
//		{
//			//Call the StartGameInScene function to start game without loading a new scene.
//			StartGameInScene();
//		}
//
        SceneCtrl.LoadScene();
    }
    public IEnumerator OnClick()
    {
        if (OpenDoor)
        {
            GetComponent <Collider>().enabled = false;

            foreach (Collider Coll in ColliderList)
            {
                Coll.enabled = false;
            }

            GetComponent <Renderer>().enabled = false;

            foreach (Renderer Rend in RendererList)
            {
                Rend.enabled = false;
            }

            DoorLeft.Play("Open");
            DoorRight.Play("Open");
            yield return(new WaitForSeconds(0.001f));

            yield return(new WaitForSeconds(DoorLeft.GetCurrentAnimatorStateInfo(0).length - 0.001f));
        }

        Scene.LoadScene(NextSceneName);
    }
Exemple #3
0
    public void ResumeGame()
    {
        string sceneName = PlayerPrefs.GetString("LastScene", SceneCtrl.NextScene);


        SceneCtrl.LoadScene(sceneName);
    }
Exemple #4
0
    IEnumerator BufferLoadScene()
    {
        foreach (string scene in sceneToLoad)
        {
            yield return(new WaitForSeconds(1));

            sc.LoadScene(scene);
        }
    }
Exemple #5
0
 private void Update()
 {
     if (isPlayer && currentHealth <= 0)
     {
         SceneControl.LoadScene("Loser");
     }
     else if (!isPlayer && currentHealth <= 0)
     {
         SceneControl.LoadScene("Winner");
     }
 }
Exemple #6
0
    private IEnumerator loadSceneCoroutine(List <string> scenes)
    {
        foreach (string scene in scenes)
        {
            yield return(new WaitForEndOfFrame());

            sc.LoadScene(scene);
        }

        yield return(null);
    }
Exemple #7
0
    void EndDialogue()
    {
        if (i >= DialogueBlock.Dialogue.Length - 1)
        {
            i = 0; //se o index passar do limite, ele reseta pro primeiro dialogo
        }
        else
        {
            i++;  //caso contrario ele adiciona 1 ao index para da proxima vez que se clicar, o proxmo dialogo seja exibido
        }
        animator.SetBool("IsOpen", false);
        StartCoroutine(displaydialogue());


        if (Boss == true)
        {
            sceneControl.LoadScene("Teste Combate");
        }

        else if (Festa == true)
        {
            if (sceneControl.getscene() == "Quarto")
            {
                sceneControl.LoadScene("Festa");
                Debug.Log("aa");
            }
            else if (sceneControl.getscene() == "Quarto2")
            {
                derrota = false;
                sceneControl.LoadScene("Festa2");
            }
            //else if (sceneControl.getscene()=="Quarto3")
            //sceneControl.LoadScene("Festa3");
        }
        else if (Reflexao == true)
        {
            sceneControl.LoadScene("Credits");
        }
    }
Exemple #8
0
 public void PlayGame()
 {
     StartCoroutine(scene.LoadScene(1.0f, "playerTest"));
     PlaySound(pick);
 }
Exemple #9
0
 public void OnClick()
 {
     Scene.LoadScene(NextSceneName);
 }