Skip to content

Instantly share code, notes, and snippets.

@ealbinu
Created June 18, 2016 20:10
Show Gist options
  • Save ealbinu/7bffa327b7b245cce61d1ea160bca90b to your computer and use it in GitHub Desktop.
Save ealbinu/7bffa327b7b245cce61d1ea160bca90b to your computer and use it in GitHub Desktop.
Cambiar de escena en Unity con Javascript utilizando el SceneManager
#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