效果是:设置触发框,当玩家触发时,显示游戏结束界面,结束游戏。
[En]
The effect is: set a trigger box, when the player triggers, display a game end interface, and end the game.
在Hierarchy中新建一个Canvas。命名为Canvas。
双击刚才创建的画布Canvas。如果需要,可以调整其属性。默认情况下这个画布会铺满整个屏幕。
编辑UI时应该关掉特效,打开2D界面。(如下图所示)
选中刚才创建的Canvas,在Canvas下新建一个UI-Image。命名为Background。这个组件用于设置UI的背景。
选中刚才创建的Background。通过调整数值令其铺满整个画布(Canvas)。
还可以通过更改其Image组件的Color属性更改其背景颜色。(如下图所示)
右键刚才创建的背景,再新建一个UI-Image作为其子项,命名为Image。
单击新组件以向其添加图片。您还可以调整其位置。(如下图所示)
[En]
Click on the new component to add a picture to it. You can also adjust its position. (as shown in the following figure)
效果如下所示。