// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; using UnityEngine; using UnityEngine.Events; namespace Microsoft.MixedReality.Toolkit.Input { /// /// Keyword/UnityEvent pair that ties voice input to UnityEvents wired up in the inspector. /// [Serializable] public struct KeywordAndResponse { /// /// Constructor. /// /// The keyword to listen for. /// The handler to be invoked when the keyword is recognized. public KeywordAndResponse(string keyword, UnityEvent response) { this.keyword = keyword; this.response = response; } [SerializeField] [Tooltip("The keyword to listen for.")] [SpeechKeyword] private string keyword; /// /// The keyword to listen for. /// public string Keyword => keyword; [SerializeField] [Tooltip("The handler to be invoked when the keyword is recognized.")] private UnityEvent response; /// /// The handler to be invoked when the keyword is recognized. /// public UnityEvent Response => response; } }