unity正交相机宽度_Unity5.0_Camera.orthographicSize 正交大小_软件教程_资源库

摘要:Unity5.0_Camera.orthographicSize 正交大小_软件教程_资源库

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)

C#

JavaScript

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//设置相机的正交尺寸为5camera.orthographic = true;camera.orthographicSize = 5;

Using specifically the main camera:

使用专门的主相机:

C#

JavaScript

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//设置主相机的正交尺寸为5Camera.main.orthographic = true;Camera.main.orthographicSize = 5;

unity正交相机宽度_Unity5.0_Camera.orthographicSize 正交大小_软件教程_资源库_第1张图片

你可能感兴趣的:(unity正交相机宽度)