首页 > 解决方案 > 当 Screen.orientaion 改变时 Unity 框架丢弃

问题描述

嗨,我在 Android 上更改 Screen.orientaion 时出现丢帧问题

在我的项目中使用 Udate(){Texture2d} 播放视频功能

以及使用此代码的 Button

if (CurrentScreenMode == ScreenMode.Vertical)
{
    Screen.orientation = ScreenOrientation.Portrait;
    //do ui set for portrait
}
else
{
    Screen.orientation = ScreenOrientation.LandscapeRight;
    //do ui set for Landscape
}

多次调用该代码然后视频帧已关闭

但是如果应用程序在后台关闭并返回应用程序

视频帧变好

问题是什么??

标签: c#unity3d

解决方案


我解决了这个问题。

它是由 CPU 和 GPU 之间的同步问题引起的

所以,我编辑它 CPU 等待 GPU 工作


推荐阅读