优化移动后 视角自动取消选择

This commit is contained in:
shenjianxing 2025-01-09 09:00:09 +08:00
parent 761e7fe16a
commit abed4a23f1
2 changed files with 19 additions and 4 deletions

View File

@ -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

View File

@ -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()
{
}