AR Design
UBC EML collab with UBC SALA - visualizing IoT data in AR
DisplaySpeechKeywords.cs
Go to the documentation of this file.
1
// Copyright (c) Microsoft Corporation. All rights reserved.
2
// Licensed under the MIT License. See LICENSE in the project root for license information.
3
4
using
UnityEngine
;
5
6
namespace
HoloToolkit
.Unity.InputModule.Tests
7
{
8
public
class
DisplaySpeechKeywords
: MonoBehaviour
9
{
10
public
SpeechInputSource
SpeechInputSource
;
11
public
TextMesh
TextMesh
;
12
13
private
void
Start()
14
{
15
if
(SpeechInputSource == null || TextMesh == null)
16
{
17
Debug
.Log(
"Please check the variables in the Inspector on DisplaySpeechKeywords.cs on"
+ name +
"."
);
18
return
;
19
}
20
21
TextMesh.text =
"Try saying:\n"
;
22
for
(var i = 0; i < SpeechInputSource.
Keywords
.Length; i++)
23
{
24
TextMesh.text +=
" "
+ SpeechInputSource.
Keywords
[i].
Keyword
+
"\n"
;
25
}
26
}
27
}
28
}
HoloToolkit.Unity.InputModule.Tests.DisplaySpeechKeywords
Definition:
DisplaySpeechKeywords.cs:8
HoloToolkit.Unity.InputModule.SpeechInputSource
SpeechInputSource allows you to specify keywords and methods in the Unity Inspector, instead of registering them explicitly in code. This also includes a setting to either automatically start the keyword recognizer or allow your code to start it.
Definition:
SpeechInputSource.cs:23
HoloToolkit.Unity.InputModule.SpeechInputSource.Keywords
KeywordAndKeyCode [] Keywords
Definition:
SpeechInputSource.cs:40
HoloToolkit.Unity.InputModule.KeywordAndKeyCode.Keyword
string Keyword
Definition:
KeywordAndKeyCode.cs:13
HoloToolkit.Unity.InputModule.Tests.DisplaySpeechKeywords.TextMesh
TextMesh TextMesh
Definition:
DisplaySpeechKeywords.cs:11
HoloToolkit.Unity.InputModule.Tests.DisplaySpeechKeywords.SpeechInputSource
SpeechInputSource SpeechInputSource
Definition:
DisplaySpeechKeywords.cs:10
Debug
HoloToolkit
UnityEngine
Assets
HoloToolkit-Examples
Input
Scripts
DisplaySpeechKeywords.cs
Generated by
1.8.12