// Use this for initialization void Start() { if (worldManagerObject == null) { worldManager = FindObjectOfType <WorldManager>(); } else { worldManager = worldManagerObject.GetComponent <WorldManager>(); } roomLoader = FindObjectOfType <RoomLoader>(); // load main menu scene keywords.Add("Main Menu", () => { worldManager.LoadScene("MainMenu"); }); // Call the OnReset method on every gameobject. keywords.Add("Reset world", () => { PersistoMatic[] objects = (PersistoMatic[])GameObject.FindObjectsOfType(typeof(PersistoMatic)); foreach (PersistoMatic obj in objects) { obj.SendMessage("OnRemove"); } }); keywords.Add("Toggle wireframe", () => { worldManager.ToggleWireframe(); }); keywords.Add("Toggle room", () => { roomLoader.ToggleRoom(); }); keywords.Add("Start scan", () => { SpatialMappingManager.Instance.StartObserver(); }); keywords.Add("Stop scan", () => { SpatialMappingManager.Instance.StopObserver(); }); keywords.Add("Place stem base", () => { worldManager.CreateStemBase(); }); keywords.Add("Place console", () => { worldManager.CreateConsole(); }); keywords.Add("Place spawn", () => { worldManager.CreateSpawnPoint(); }); keywords.Add("Place scoreboard", () => { worldManager.CreateScoreboard(); }); keywords.Add("Place metal barrel", () => { worldManager.CreateMetalBarrel(); }); //not yet ready //keywords.Add("Place room model", () => //{ // worldManager.CreateRoomModel(); //}); keywords.Add("Place infinite ammo box", () => { worldManager.CreateInfiniteAmmoBox(); }); keywords.Add("Place path finder", () => { worldManager.CreatePathFinder(); }); keywords.Add("Place start button", () => { worldManager.CreateStartButton(); }); keywords.Add("Place mist", () => { worldManager.CreateMist(); }); keywords.Add("Place mist end", () => { worldManager.CreateMistEnd(); }); keywords.Add("Place hot spot", () => { worldManager.CreateHotspot(); }); keywords.Add("Place Target", () => { worldManager.CreateTarget(); }); keywords.Add("Remove", () => { var focusObject = GazeManager.Instance.HitObject; if (focusObject != null) { // Call the OnDrop method on just the focused object. focusObject.SendMessage("OnRemove"); } }); // Tell the KeywordRecognizer about our keywords. keywordRecognizer = new KeywordRecognizer(keywords.Keys.ToArray()); // Register a callback for the KeywordRecognizer and start recognizing! keywordRecognizer.OnPhraseRecognized += KeywordRecognizer_OnPhraseRecognized; keywordRecognizer.Start(); }