From 4984936411a31deb480220aab074b90ef62307a9 Mon Sep 17 00:00:00 2001 From: shenjianxing <”315615051@qq.com“> Date: Mon, 24 Mar 2025 09:29:31 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9VR=E7=89=88=20UI=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Scripts/UI/UICameraSwitch.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Assets/Scripts/UI/UICameraSwitch.cs b/Assets/Scripts/UI/UICameraSwitch.cs index ba02ad78..5ff424ad 100644 --- a/Assets/Scripts/UI/UICameraSwitch.cs +++ b/Assets/Scripts/UI/UICameraSwitch.cs @@ -79,7 +79,10 @@ namespace QFramework.Example Near.gameObject.SetActive(mData.nearPos != default); Far.gameObject.SetActive(mData.normalPos != default); - +#if VR + Near.gameObject.SetActive(false); + Far.gameObject.SetActive(false); +#endif if (string.IsNullOrEmpty(mData.isOn)) { if (Near.isOn && Near.gameObject.activeSelf) @@ -123,7 +126,7 @@ namespace QFramework.Example private void Update() { -#if UNITY_STANDALONE_WIN +#if UNITY_STANDALONE_WIN && !VR if (Near.isOn == true || Far.isOn == true) { if (Input.GetKeyDown(KeyCode.W) || Input.GetKeyDown(KeyCode.A) || Input.GetKeyDown(KeyCode.S) || Input.GetKeyDown(KeyCode.D))