Skip to content

Commit

Permalink
Fix SeeItSayItLabelEnabler not unsubscribing on destroy (#593) (#792)
Browse files Browse the repository at this point in the history
  • Loading branch information
Anonymous committed Jun 26, 2024
1 parent 895e6e3 commit 7ec972d
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -165,17 +165,19 @@ protected virtual void Start()

protected virtual void OnDestroy()
{
#if MRTK_INPUT_PRESENT && MRTK_SPEECH_PRESENT && UNITY_LOCALIZATION_PRESENT
#if MRTK_INPUT_PRESENT && MRTK_SPEECH_PRESENT
if (pressableButton != null)
{
pressableButton.OnSpeechRecognitionKeywordChanged.RemoveListener(UpdateLabel);
#if UNITY_LOCALIZATION_PRESENT
if (!localizedPattern.IsEmpty)
{
localizedPattern.StringChanged += OnLocalizedPatternChanged;
}
#endif
}
#endif
}
}

protected virtual void UpdateLabel(string keyword)
{
Expand Down

0 comments on commit 7ec972d

Please sign in to comment.