Exemple #1
0
    // Initialize
    void Start()
    {
        task.initializeTask();
        // hide additional info
        GameObject.Find("Submenu - Sub").GetComponent <Canvas> ().enabled  = false;
        GameObject.Find("Submenu - Int").GetComponent <Canvas> ().enabled  = false;
        GameObject.Find("Submenu - Misc").GetComponent <Canvas> ().enabled = false;
        GameObject.Find("Submenu - Sop").GetComponent <Canvas> ().enabled  = false;
        GameObject.Find("Submenu - Time").GetComponent <Canvas>().enabled  = false;
        //Initialize keywords and actions for keyword recognizer (add keywords and events)
        keywords.Add("Open Suit", () =>         // open overlays
        {
            openOverlay(1);
        });
        keywords.Add("Open Time", () =>
        {
            openOverlay(2);
        });
        keywords.Add("Open Pad", () =>
        {
            openOverlay(3);
        });
        keywords.Add("Open Task", () =>
        {
            openOverlay(4);
        });
        keywords.Add("Open All", () =>
        {
            allOn();
        });
        keywords.Add("Clear Suit", () =>         // clear overlays
        {
            clearOverlay(1);
        });
        keywords.Add("Clear Time", () =>
        {
            clearOverlay(2);
        });
        keywords.Add("Clear Pad", () =>
        {
            clearOverlay(3);
        });
        keywords.Add("Clear Task", () =>
        {
            clearOverlay(4);
        });
        keywords.Add("Clear All", () =>
        {
            alloff();
        });
        keywords.Add("Show Sub", () =>          // sub-menu selected
        {
            subMenuSelected(1);
        });
        keywords.Add("Show Internal", () =>
        {
            subMenuSelected(2);
        });
        keywords.Add("Show Misc", () =>
        {
            subMenuSelected(3);
        });
        keywords.Add("Show SOP", () =>
        {
            subMenuSelected(4);
        });
        keywords.Add("Hide Submenu", () =>          // sub-menu hide
        {
            subMenuRestore();
        });
        keywords.Add("Next Step", () =>          // sub-menu hide
        {
            task.NextStep();
        });
        keywords.Add("Previous Step", () =>          // sub-menu hide
        {
            task.PrevioustStep();
        });
        keywords.Add("Show Time", () =>          // control time menu
        {
            GameObject.Find("Submenu - Time").GetComponent <Canvas>().enabled = true;
        });
        keywords.Add("Hide Time", () =>          // control time menu
        {
            GameObject.Find("Submenu - Time").GetComponent <Canvas>().enabled = false;
        });

        keywordRecognizer = new KeywordRecognizer(keywords.Keys.ToArray());
        keywordRecognizer.OnPhraseRecognized += KeywordRecognizer_OnPhraseRecognized;
        keywordRecognizer.Start();
    }
    // Initialize: data stream, voice commands
    void Start()
    {
        // start timer
        timeNames [0] = "Time Life Battery";
        timeNames [1] = "Time Life Oxygen";
        timeNames [2] = "Time Life Water";
        startTime     = DateTime.Now;
        GameObject.Find("EVA Clock").GetComponent <Text> ().text = "00:00:00";
        // initialize data stream and task manager
        dataStream.onStart();
        task.initializeTask();
        // hide additional info (submenus)
        GameObject.Find("Submenu - Sub").GetComponent <Canvas> ().enabled  = false;
        GameObject.Find("Submenu - Int").GetComponent <Canvas> ().enabled  = false;
        GameObject.Find("Submenu - Misc").GetComponent <Canvas> ().enabled = false;
        GameObject.Find("Submenu - Sop").GetComponent <Canvas> ().enabled  = false;
        GameObject.Find("Submenu - Time").GetComponent <Canvas>().enabled  = false;
        //Initialize keywords and actions for keyword recognizer (add keywords and events)
        keywords.Add("Open Suit", () =>         // open overlays
        {
            Commands.openOverlay(1);
        });
        keywords.Add("Open Time", () =>
        {
            Commands.openOverlay(2);
        });
        keywords.Add("Open Pad", () =>
        {
            Commands.openOverlay(3);
        });
        keywords.Add("Open Task", () =>
        {
            Commands.openOverlay(4);
        });
        keywords.Add("Open All", () =>
        {
            Commands.allOn();
        });
        keywords.Add("Clear Suit", () =>         // clear overlays
        {
            Commands.clearOverlay(1);
        });
        keywords.Add("Clear Time", () =>
        {
            Commands.clearOverlay(2);
        });
        keywords.Add("Clear Pad", () =>
        {
            Commands.clearOverlay(3);
        });
        keywords.Add("Clear Task", () =>
        {
            Commands.clearOverlay(4);
        });
        keywords.Add("Clear All", () =>
        {
            Commands.alloff();
        });
        keywords.Add("Show Sub", () =>          // sub-menu selected
        {
            Commands.subMenuSelected(1);
            selectedSubMenu = "Submenu - Sub";
        });
        keywords.Add("Show Internal", () =>
        {
            Commands.subMenuSelected(2);
            selectedSubMenu = "Submenu - Int";
        });
        keywords.Add("Show Misc", () =>
        {
            Commands.subMenuSelected(3);
            selectedSubMenu = "Submenu - Misc";
        });
        keywords.Add("Show SOP", () =>
        {
            Commands.subMenuSelected(4);
            selectedSubMenu = "Submenu - Sop";
        });
        keywords.Add("Show Time", () =>          // show time submenu
        {
            GameObject.Find("Submenu - Time").GetComponent <Canvas>().enabled = true;
        });
        keywords.Add("Hide Time", () =>          // hide time submenu
        {
            GameObject.Find("Submenu - Time").GetComponent <Canvas>().enabled = false;
        });
        keywords.Add("Submenu Back", () =>          // sub-menu hide
        {
            Commands.subMenuRestore();
        });
        keywords.Add("Next Step", () =>          // navigate task
        {
            task.NextStep();
        });
        keywords.Add("Previous Step", () =>
        {
            task.PrevioustStep();
        });
        foreach (string info in keys)
        {
            keywords.Add("Push" + info, () =>              // Push information to scratch pad
            {
                selected = info;
            });
        }
        keywords.Add("Errase Pad", () =>          // clear scratch pad
        {
            selected = "";
        });

        keywordRecognizer = new KeywordRecognizer(keywords.Keys.ToArray());
        keywordRecognizer.OnPhraseRecognized += KeywordRecognizer_OnPhraseRecognized;
        keywordRecognizer.Start();
    }