参考unity官方文档

Assigning Layers

Now that you have created a new layer, you have to assign the layer to one of the game objects.

unity相机渲染不同层的东西和相机的深度_unity

In the tag manager we assigned the Player layer to be in layer 8.

Drawing only a part of the scene with the camera’s culling mask

Using the camera’s culling mask, you can selectively render objects which are in one particular layer. To do this, select the camera that should selectively render objects.

Modify the culling mask by checking or unchecking layers in the culling mask property.

unity相机渲染不同层的东西和相机的深度_unity_02

Be aware that UI elements aren’t culled. Screen space canvas children do not respect the camera’s culling mask.

深度小则先画,最后大的会把小的视野挡住。相当于最后只能看到depth大的那个相机看到的。

unity相机渲染不同层的东西和相机的深度_unity_03

把两个相机看到的都能显示出来


unity相机渲染不同层的东西和相机的深度_unity_04

unity相机渲染不同层的东西和相机的深度_unity_05