在 Unity 3D 中可以把摄像机设置为正交。正交摄像机与 Unity 3D 中普通摄像机相比没有透视效果(近大远小),所以正交相机一般可以用于 2D 游戏开发或者是 3D 游戏的 UI 开发。
Camera cam;
public int minSize; //How far can the player zoom in?
public int maxSize; //How far can the player zoom out?
public int maxSize; //How far can the player zoom out?
// Use this for initialization
void Start () {
cam = GetComponent<Camera>();
//Set the size of the camera between middle and max
cam.orthographicSize = (minSize + maxSize) / 2;
void Start () {
cam = GetComponent<Camera>();
//Set the size of the camera between middle and max
cam.orthographicSize = (minSize + maxSize) / 2;
本文介绍如何在Unity3D中使用正交摄像机,并提供了设置摄像机缩放范围的示例代码。正交摄像机适用于2D游戏开发及3D游戏的UI设计。
4032

被折叠的 条评论
为什么被折叠?



