菜鸟教程小白 发表于 2022-12-12 14:45:49

ios - 统一到 ios 缺口和安全是问题


                                            <p><p>我尝试过统一创建游戏并在任何苹果设备上的 ios 上构建它,除了 iphone x 之外没有问题。截图如下。 <a href="/image/14nKA.png" rel="noreferrer noopener nofollow">enter image description here</a> .它被iphone x缺口覆盖,然后当角色在左侧或右侧时,它被切成了一半。有没有其他解决方案或插件可以用来解决这个问题?是否有统一设置或 xcode 设置? .谢谢你</p></p>
                                    <br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
                                            <p><p>关于 iPhone X 的刘海,您可以使用 <a href="https://forum.unity.com/threads/iphone-x-notch-in-screen.495028/" rel="noreferrer noopener nofollow">this</a> :</p>

<pre><code>Screen.safeArea
</code></pre>

<p>这是确定屏幕实际“安全区域”的便捷方式。在 <a href="https://forum.unity.com/threads/iphone-x-notch-in-screen.495028/" rel="noreferrer noopener nofollow">this thread</a> 中了解更多信息. </p>

<p>关于将角色切成两半,这可能是您需要根据您的游戏逻辑手动处理的事情。通过获取 <code>Screen.width</code> - 您应该能够调整相机(缩小)或限制角色移动,使其不会越过屏幕边缘。 </p></p>
                                   
                                                <p style="font-size: 20px;">关于ios - 统一到 ios 缺口和安全是问题,我们在Stack Overflow上找到一个类似的问题:
                                                        <a href="https://stackoverflow.com/questions/51256555/" rel="noreferrer noopener nofollow" style="color: red;">
                                                                https://stackoverflow.com/questions/51256555/
                                                        </a>
                                                </p>
                                       
页: [1]
查看完整版本: ios - 统一到 ios 缺口和安全是问题