Unity 2018 Cookbook(Third Edition)
上QQ阅读APP看书,第一时间看更新

Creating UI Buttons to move between scenes

As well as scenes where the player plays the game, most games will have menu screens, which display to the user messages about instructions, high scores, the level they have reached so far, and so on. Unity provides UI Buttons to offer users a simple way to indicate their choices.

In this recipe, we'll create a very simple game consisting of two screens, each with a button to load the other one, as illustrated in the screenshot: