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定义。

  • C#

  • JavaScript

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:

用于专门的主相机:

  • C#

  • JavaScript

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;


,