我有一个关于unity的网络播放器的不同尺寸的问题。
I have a scene where the user will select the level he wants to play and i the camera can move only on up and down , not sideways , and the user can not zoom in or out. 我的问题是,由于不同的屏幕尺寸,相机尺寸将退出游戏的边界,用户将看到场景的黑色部分。

我需要做的是夹住相机的ortographicSize。在地图的左边和右边,我有两个对象,它们是边界。
我怎样才能夹住相机的大小,使它不会越过边界?
谢谢
发布于 2014-07-23 07:14:51
camera.orthographicSize是垂直体积的一半(您可以使用水平体积的分辨率来获取所需的垂直体积)。
发布于 2014-07-25 14:20:13
你可能想要实现这个:sizeX/size = width/Height,用它来计算SizeX。
https://stackoverflow.com/questions/24888930
复制相似问题