Created
June 18, 2016 20:10
-
-
Save ealbinu/7bffa327b7b245cce61d1ea160bca90b to your computer and use it in GitHub Desktop.
Cambiar de escena en Unity con Javascript utilizando el SceneManager
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma strict | |
//Se define una variable de tipo SceneManager | |
var escenas : UnityEngine.SceneManagement.SceneManager; | |
function Start () { | |
//Se puede hacer la llamada a la función "CambiarEscena" y pasar dentro el nombre de la escena. | |
//CambiarEscena("menu"); | |
} | |
function Update () { | |
} | |
function CambiarEscena(nombre : String){ | |
//Utilizando LoadScene se pasa el nombre de la escena a cargar. | |
escenas.LoadScene(nombre); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment