user-interface - 小米的 Unity3d UI 问题
问题描述
在小米设备中,在相机信箱之外绘制了图像在其他设备中一切都正确我附上了sumsung和xiaomi图像,看起来丑陋的截图是小米,三星很好看
浮动目标方面 = 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;
}
解决方案
推荐阅读
- python - 一堆立方体的体积
- sabre - 调用 Sabre BargainFinderMax REST API 时出错 — ERR.2SG.PROVIDER_TIMEOUT
- python - url 未定义,在 python 和 selenium 中
- android - PopupMenu - 如何?
- android - camera2 大小的表面视图
- arrays - 查找清空数组的最小操作数
- python - Python中的枚举和二维数组?
- php - 将大整数转换为二进制 Little-Endian php
- android - 在节点js服务器android上上传图像(多部分数据)
- python - 在Python中生成具有三个不同长度字母的随机字符串