在小米设备上,在相机的信箱外面画了一张图片在其他设备上,一切都是正确的我附上了sumsung和小米的图片,看起来丑陋的截图是小米,三星的好看
float targetaspect = 750f / 1334f;
// determine the game window's current aspect ratio
float windowaspect = (float)Screen.width / (float)Screen.height;
// current viewport height should be scaled by this amount
float scaleheight = windowaspect / targetaspect;
// obtain camera component so we can modify its viewport
Camera camera = GetComponent<Camera>();
// if scaled height is less than current height, add letterbox
if (scaleheight < 1.0f)
{
Rect rect = camera.rect;
rect.width = 1.0f;
rect.height = scaleheight;
rect.x = 0;
rect.y = (1.0f - scaleheight) / 2.0f;
camera.rect = rect;
}



发布于 2019-01-19 23:18:34
尝试将图像设置为钳位,而不是重复。
这将产生黑色边框的结果,但你不会有那种奇怪的纹理

发布于 2019-02-05 02:34:52
我不知道是什么导致了这个问题,但我以一种棘手的方式解决了它。我刚刚添加了第二个摄像头来显示黑色背景。只有我的主相机的视口是信箱的,而不是第二个相机。所以它使显示看起来很好
https://stackoverflow.com/questions/54268365
复制相似问题