Camera.depth 深度

var depth : float

Description描述

Camera's depth in the camera rendering order.

相机在渲染顺序上的深度。

Cameras with lower depth are rendered before cameras with higher depth.

具有较低深度的相机将在较高深度的相机之前渲染。

Use this to control the order in which cameras are drawn if you have multiple cameras and some of them don't cover the full screen.

如果你有多个相机并且其中一些不需要覆盖整个屏幕,可以使用这个来控制相机的绘制次序。

参见: Camera.rect 属性.

using UnityEngine;

using System.Collections;



public class example : MonoBehaviour {

	public void Awake() {

		camera.depth = Camera.main.depth + 1;

	}

}
// Set this camera to render after the main camera

//设置这个相机在主相机之后渲染



camera.depth = Camera.main.depth + 1;
Page last updated: 2011-8-5