- Knowledge Base
- Developer
- Unity Development Examples
-
Developer
-
RealWear Navigator™ 500 Series
- Overview
- Features and Specifications
- Wearing Your Device
- Device Setup
- Interacting with Your Device
- Device Power
- Battery Use
- Home Screen
- My Programs
- My Camera
- My Files
- My Training
- Safety
- Device Care
- Ownership Information
- User Guide
- FAQ
- Thermal Camera Module
- Display Technology Comparison
- Cleaning Your Device
-
RealWear Cloud
-
RealWear Releases
-
RealWear HMT-1®
-
RealWear HMT-1Z1®
-
RealWear Apps
-
Configure
-
RealWear Modules & Accessories
-
RealWear Navigator™ Series
Unity Development Example – Voice Commands
Since the HMT is driven by voice commands rather than touch, it is essential to voice enable your Unity application for the user to perform any actions when running on the HMT.
Adding voice commands is achieved by passing the required commands as a string, and a callback which WearHF will call when that voice command is spoken:
void Start()
{
// Initialize the wearHF object
// NOTE: The plugin registers itself to the WearHF system in the
// GameObject’s Awake function, so any calls to the plugin need to occur
// after that. The start function is a good choice.
m_wearHF = GameObject.Find("WearHF Manager").GetComponent<WearHF>();
// Add a custom command
m_wearHF.AddVoiceCommand("Command 1", LogCommandCallback);
}
/// <summary>
/// Called when our custom commands are spoken.
/// </summary>
/// <param name="voiceCommand">The voice command that was recognized.</param>
private void LogCommandCallback(string voiceCommand)
{
Debug.Log("Command Recognized: " + voiceCommand);
}