Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- namespace HoloToolkit.Unity.InputModule
- {
- public class HighlightCreator : MonoBehaviour, ISpeechHandler {
- public GameObject go;
- void Start()
- {
- Instantiate(go, new Vector3(0f, 0f, 2f), Quaternion.Euler(new Vector3(0, 90, 0)));
- go.transform.localScale = new Vector3(0.01f, 0.1f, 0.1f);
- }
- public void createHighlight(string keyWord)
- {
- switch (keyWord.ToLower())
- {
- case "next item":
- Debug.Log("Next Item");
- Instantiate(go, new Vector3(0f, 0.5f, 2f), Quaternion.Euler(new Vector3(0, 90, 0)));
- break;
- case "remove all":
- Debug.Log("Remove all");
- Destroy(this.go);
- break;
- }
- }
- public void OnSpeechKeywordRecognized(SpeechEventData eventData)
- {
- createHighlight(eventData.RecognizedText);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement