c# - 当 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
}
多次调用该代码然后视频帧已关闭
但是如果应用程序在后台关闭并返回应用程序
视频帧变好
问题是什么??
解决方案
我解决了这个问题。
它是由 CPU 和 GPU 之间的同步问题引起的
所以,我编辑它 CPU 等待 GPU 工作
推荐阅读
- laravel - 我如何使用 Laravel Sanctum 同时处理 SPA 和基于令牌的身份验证
- c# - 与界面交互
不同实现列表上的方法 - php - PHP没有迭代
- java - 如何使用查询参数过滤数据?
- angular - Angular - 将可观察更改为不可观察
- asp.net-core - 微前端的 IdentityServer4 访问令牌
- python - 使用 python simpleaudio 播放 wav 文件会产生:SimpleaudioError: Unable to start queue。-- 代码:-66681
- performance - 在 Dart 2 / Flutter 中使用 `const` 使用“实例化”对象时有任何性能提升吗?
- google-cloud-platform - Terraform:如何将防火墙规则从单独的模块注入子网?
- azure-communication-services - 有没有办法在 Azure 通信服务 Chat 中了解用户的在线状态?