修复了手游横屏问题
This commit is contained in:
@@ -37,6 +37,17 @@ public class graphicSettings : MonoBehaviour
|
||||
|
||||
public static void ApplySavedDisplaySettingsAtStartup(MonoBehaviour coroutineRunner)
|
||||
{
|
||||
// 移动端(Android/iOS)由系统管理分辨率与全屏,没有"窗口模式"概念。
|
||||
// 这里的 PC 逻辑(Screen.SetResolution 到 PC 存的窗口分辨率 / 切 Windowed 模式 /
|
||||
// 后续的 Win32 SetWindowLong 窗口样式操作)在手机上会破坏渲染表面,导致启动黑屏
|
||||
// (只剩最顶层加载 Canvas 的 "%" 文本可见)。移动端直接跳过,交给系统与横屏设置处理。
|
||||
#if UNITY_ANDROID || UNITY_IOS
|
||||
if (!Application.isEditor)
|
||||
{
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
int screenMode = PlayerPrefs.GetInt(PrefKeyScreenMode, 0);
|
||||
screenMode = Mathf.Clamp(screenMode, 0, 2);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user