tspaddock / noway

0 stars 0 forks source link

Voice Command using Speech Input Handler #5

Closed tspaddock closed 5 years ago

tspaddock commented 7 years ago

Hello, This is very frustrating but I had it working before with Keywordmanager.cs but now that I am trying to upgrade to Speech Input Handler I cant get things to work. Please help! All I want to happen is upon HoloLens voice command a parent and its children objects will disappear/reappear. I've inserted the Speech Input Source and Speech Input Manager into a manager object and the following code to be referenced by the Speech Handler within the gameobject Parent:

using System.Collections; using System.Collections.Generic; using HoloToolkit.Unity; using UnityEngine;

public class HideLayer : MonoBehaviour { public void showHidePlane() { if(GetComponent().enabled == true) { GetComponent().enabled = false; GetComponentInParent().enabled = false; } else { GetComponent().enabled = true; GetComponentInParent().enabled = true; } } }

Any Ideas would make my day!! Thanks!