Building Scenes

From ETC Public Wiki
Jump to: navigation, search

Building a Scene


  • First, you would have to load all of your scenes into the build. You can access the build settings in File >> Build Settings
  • Add your current scene into the "Scenes in Build" List. It will show up as "yourscenename.unity", followed by a number which is the index of that scene.


Changing a Scene


  • To change scenes, you would have to use Application.LoadLevel()
  • You can use the scene name, as well as the scene index.
void OnGUI()
{
    if (GUI.Button (new Rect (20,70,80,20), "Next Level")) 
    {
	Application.LoadLevel(2); 

     }

       
}