connecting scenes together to make a game

问:

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");

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值