修复了手游横屏问题

This commit is contained in:
FloatGaming
2026-07-15 21:38:57 +08:00
parent 959a1bd157
commit 1022d1587d
5 changed files with 16 additions and 5 deletions
@@ -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);