首页 > 解决方案 > 小米的 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;
    }

问题在顶部和底部 问题在顶部和底部 它应该怎么看。 它在三星

标签: user-interfaceunity3dxiaomi

解决方案


尝试将图像设置为钳制而不是重复。

这将给出黑色边框的结果,但你不会有那种奇怪的纹理

在此处输入图像描述


推荐阅读