如何在顶级Unity上显示ui元素 [英] How to show ui elements on top Unity

查看:247
本文介绍了如何在顶级Unity上显示ui元素的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将我的ui元素显示在其他元素之上?

how can I show my ui elements on top of the others ?

http://prntscr.com/brjccg 您可以看到面板的右侧,但左侧在地图对象下.如何解决我想同时看到它的两面?

http://prntscr.com/brjccg you can see the right side of the panel but the left one is under the map object. How can fix that i want to see both sides of it ?

以下是 http://prntscr.com/brjdab

推荐答案

Unity从上到下呈现UI.您想要放在顶部的所有内容都应放在层次结构的最后.这仅适用于UI元素.要在2D Sprite对象和UI元素(例如Canvas)之间更改渲染顺序,可以更改Sprite Renderer组件的图层中的顺序属性,也可以通过更改排序顺序画布的属性.具有更大价值的对象会显示在顶部.

Unity renders UI from top to bottom. Anything you want on top should be placed at last in hierarchy. This only works with UI elements. To change rendering order between 2D Sprite Objects and UI elements e.g Canvas, you can either change Order in Layer property of Sprite Renderer component or the same behaviour can be achieved by changing Sort Order property of Canvas. Object with greater value appears on top.

注意:您还可以使用菜单添加新的排序层:

Note: You can also add new sorting layers using menu:

编辑>项目设置>标记和图层

Edit > Project Settings > Tags and Layers

这篇关于如何在顶级Unity上显示ui元素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆