Camera.orthographicSize 正交大小

var orthographicSize : float

Description描述

Camera's half-size when in orthographic mode.

在正交模式下相机的一半尺寸。

This is half of the vertical size of the viewing volume. Horizontal viewing size varies depending on viewport's aspect ratio. Orthographic size is ignored when camera is not orthographic (see orthographic).

这个为视体垂直大小的一半,水平视口到校取决于视口的长宽比,相机不是正交时,Orthographic size被忽略(参考 orthographic

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
	public void Awake() {
		camera.orthographic = true;
		camera.orthographicSize = 5;
	}
}
// Set the camera's ortho size to 5
//设置相机的正交尺寸为5

camera.orthographic = true;
camera.orthographicSize = 5;

Using specifically the main camera:

使用专门的主相机:

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
	public void Awake() {
		Camera.main.orthographic = true;
		Camera.main.orthographicSize = 5;
	}
}
// Set the main camera's ortho size to 5
//设置主相机的正交尺寸为5

Camera.main.orthographic = true;
Camera.main.orthographicSize = 5; 
最后修改:2011年3月6日 Sunday 11:12

本脚本参考基于Unity 3.4.1f5

英文部分版权属©Unity公司所有,中文部分© Unity圣典 版权所有,未经许可,严禁转载 。