问:
Just getting into Unity and I have lots of reading and playing to do but a question as I wrap my head around all thingsUnity....
A full game has (at least) the following scenes (I understand that one should implement each of these as seperate scenes):
- Startup screen
- main menu
- game (multiple levels each being a scene)
- pause menu
- game exit menu/display etc.
But I have not yet come across documentation that shows how to create multiple scenes in Unity under one project.
If I load the island demo (default) and create a new scene the original island demo scene disappears and I can't get back to it.
Also, how does one tie scenes together so that, for example, on the main menu if user click/select the 'Start Game' object then how to transition to the game scene from the main menu scene.
Pointers to documentation or answers for this appreciated.
Thanks for any help/pointers!
回答:
Unity doesn't keep scenes open as Tabs. You can only have one #Scene window open at a time.
But the Scene file did not disappear, it is available in the "Project" tab. You can even search for it by typing in characters in the area with the magnifying glass also on the Project tab.
And Application.LoadLevel
is what you need to open a scene programmatically
http://unity3d.com/support/documentation/ScriptReference/Application.LoadLevel.html
And be sure to check out the fantastic Tutorials at Unity:
http://unity3d.com/support/resources/tutorials/
EDIT/
To manage which scenes load and in what order:
Choose File > Build Settings. From there you can add and remove scenes. To remove a scene just highlight it and hit Delete on your keyboard. You can also change their order by dragging and dropping the scene names.
The number to the right of the scene name denotes its loading order or index. i.e. 0, 1, 2. Like in the Application.LoadLevel example:
// Loads the level with index 0
Application.LoadLevel (0);
or
// Load the level named "HighScore".
Application.LoadLevel ("HighScore");