Skip to content

Commit 0397cfa

Browse files
authored
Merge pull request #360 from r2d2rigo/master
Fix KeywordManager not stopping when deactivated
2 parents ab268da + f04ca64 commit 0397cfa

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

Assets/HoloToolkit/Input/Scripts/Voice/KeywordManager.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,22 @@ void OnDestroy()
8787
}
8888
}
8989

90+
void OnDisable()
91+
{
92+
if (keywordRecognizer != null)
93+
{
94+
StopKeywordRecognizer();
95+
}
96+
}
97+
98+
void OnEnable()
99+
{
100+
if (keywordRecognizer != null && RecognizerStart == RecognizerStartBehavior.AutoStart)
101+
{
102+
StartKeywordRecognizer();
103+
}
104+
}
105+
90106
private void ProcessKeyBindings()
91107
{
92108
foreach (var kvp in KeywordsAndResponses)

0 commit comments

Comments
 (0)