-
Notifications
You must be signed in to change notification settings - Fork 2
uGUI
zjy edited this page Jul 13, 2016
·
1 revision
uGUI
Canvas
The Canvas is the area that all UI elements should be inside. The Canvas is a Game Object with a Canvas component on it, and all UI elements must be children of such a Canvas
- Screen Space - Overlay
- Screen Space - Camera
- World Space

UI elements in the Canvas are drawn in the same order they appear in the Hierarchy. The first child is drawn first, the second child next, and so on. If two UI elements overlap, the later one will appear on top of the earlier one.
To change which element appear on top of other elements, simply reorder the elements in the Hierarchy by dragging them.
The order can also be controlled from scripting by using these methods on the Transform component: SetAsFirstSibling, SetAsLastSibling, and SetSiblingIndex.

参考: