diff --git a/Assets/Art/UIPrefab/UICameraSwitch.prefab b/Assets/Art/UIPrefab/UICameraSwitch.prefab index 92fbe6e1..d287323b 100644 --- a/Assets/Art/UIPrefab/UICameraSwitch.prefab +++ b/Assets/Art/UIPrefab/UICameraSwitch.prefab @@ -17,7 +17,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 1 + m_IsActive: 0 --- !u!224 &3411569463940388114 RectTransform: m_ObjectHideFlags: 0 @@ -226,7 +226,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 1 + m_IsActive: 0 --- !u!224 &7775706862032139777 RectTransform: m_ObjectHideFlags: 0 @@ -826,7 +826,7 @@ MonoBehaviour: onValueChanged: m_PersistentCalls: m_Calls: [] - m_IsOn: 1 + m_IsOn: 0 --- !u!1 &8974889932437628810 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/Scripts/UI/UICameraSwitch.cs b/Assets/Scripts/UI/UICameraSwitch.cs index dd2893cf..045681dd 100644 --- a/Assets/Scripts/UI/UICameraSwitch.cs +++ b/Assets/Scripts/UI/UICameraSwitch.cs @@ -33,7 +33,7 @@ namespace QFramework.Example Near.transform.Find("Bg/Line").gameObject.SetActive(isOn); }); Far.onValueChanged.AddListener(isOn => - { + { if (isOn) { SetNormal(); @@ -68,6 +68,21 @@ namespace QFramework.Example } } + private void Update() + { +#if UNITY_STANDALONE_WIN + if (Near.isOn == true || Far.isOn == true) + { + if (Input.GetKeyDown(KeyCode.W) || Input.GetKeyDown(KeyCode.A) || Input.GetKeyDown(KeyCode.S) || Input.GetKeyDown(KeyCode.D)) + { + Near.isOn = false; + Far.isOn = false; + } + } + +#endif + } + protected override void OnShow() { }