Camera.orthographic 正交

var orthographic : bool

Description描述

Is the camera orthographic (true) or perspective (false)?

相机是正交的(true),是透视的(false)?

When ortho is true, camera's viewing volume is defined by orthographicSize. When orthographic is false, camera's viewing volume is defined by fieldOfView.

如果为true,相机的视野由orthographicSize定义。如果为false,相机的视野由fieldOfView定义。

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
	public void Awake() {
		camera.orthographic = true;
	}
}
// Set the camera to be orthograpghic
//设置相机为正交

camera.orthographic = true;

Specifically for the main camera:

用于专门的主相机:

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
	public void Awake() {
		Camera.main.orthographic = true;
	}
}
// Set the main camera to be orthographic
//设置主相机为正交

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

本脚本参考基于Unity 3.4.1f5

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