Skip to content

Commit e4115eb

Browse files
author
Wouter Spaas
committed
Reset Focus on GlobalVisualReset if the Interactable is not visually focussed
1 parent 1a9fb98 commit e4115eb

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

Assets/MRTK/SDK/Features/UX/Interactable/Scripts/Interactable.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1302,7 +1302,7 @@ protected IEnumerator GlobalVisualReset(float time)
13021302
yield return new WaitForSeconds(time);
13031303

13041304
HasVoiceCommand = false;
1305-
if (!HasFocus)
1305+
if (HasFocus && focusingPointers.Count == 0)
13061306
{
13071307
HasFocus = false;
13081308
}
@@ -1513,13 +1513,11 @@ public void OnSpeechKeywordRecognized(SpeechEventData eventData)
15131513

15141514
if (eventData.Command.Keyword == VoiceCommand && (!VoiceRequiresFocus || HasFocus) && CanInteract())
15151515
{
1516-
bool hadFocus = HasFocus;
15171516
StartGlobalVisual(true);
15181517
HasVoiceCommand = true;
15191518
SendVoiceCommands(VoiceCommand, 0, 1);
15201519
TriggerOnClick();
15211520
eventData.Use();
1522-
HasFocus = hadFocus;
15231521
}
15241522
}
15251523

0 commit comments

Comments
 (0)