示例#1
0
    void Start()
    {
        //head = GameObject.Find("Head").transform;
        surface = GameObject.Find("Surface");


        //help = GameObject.Find("HelpPanel");
        assistant = GameObject.Find("Assistant");

        //setup lookat bones
        lookAt    = assistant.GetComponent <LookAtIK>();
        centerEye = GameObject.Find("CenterEyeAnchor").transform;


        agent_rightHand = GameObject.Find("RightHand").transform;
        user_rightHand  = GameObject.Find("RightHandAnchor").transform;
        //initialize the task
        task = surface.AddComponent <Task4Rules>();
        task.Initialize();
        action = surface.AddComponent <Actions>();
        action.Initialize(task);
        dict = task.dict;
        // InitOVRHand();

        //test correctAction

        //task.CreateNewTask(3);
        ////task.ShowDemos();
        //action.ActionTaken(3);


        ////load audio source
        LoadAudios();
        audioSource = assistant.GetComponent <AudioSource>();
        PlayAudio(clips[0]);  //start to music and say the introduction of the system

        ////start the level loop
        keywords.Add("start", () => { StartCalled(); });
        keywords.Add("repeat", () => { StartCalled(); });
        keywords.Add("demostration", () => { DemoCalled(); });
        keywords.Add("continue", () => { ContinueCalled(); });
        keywords.Add("done", () => { DoneCalled(); });

        keywordRecognizer = new KeywordRecognizer(keywords.Keys.ToArray());
        keywordRecognizer.OnPhraseRecognized += KWRegOnPhraseRecognized;
        keywordRecognizer.Start();
    }
示例#2
0
    //Material red, m1;
    void Start()
    {
        surface = GameObject.Find("Surface");


        //help = GameObject.Find("HelpPanel");
        assistant = GameObject.Find("Assistant");

        //ik = assistant.GetComponent<FullBodyBipedIK>();
        //setup lookat bones
        lookAt    = assistant.GetComponent <LookAtIK>();
        centerEye = GameObject.Find("CenterEyeAnchor").transform;


        agent_rightHand = GameObject.Find("RightHand").transform;
        user_rightHand  = GameObject.Find("RightHandAnchor").transform;
        //initialize the task
        task = surface.AddComponent <Task4Rules>();
        task.Initialize();
        action = surface.AddComponent <Actions>();
        action.Initialize(task);
        dict = task.dict;

        //s_action = gameObject.GetComponent<SuggestAction>();
        // InitOVRHand();

        //test correctAction

        //task.CreateNewTask(3);
        ////task.ShowDemos();
        //action.ActionTaken(3);


        ////load audio source
        LoadAudios();
        audioSource = assistant.GetComponent <AudioSource>();
        PlayAudio(clips[0]);  //start to music and say the introduction of the system
        //MoveTargHolder();
        ////start the level loop
        keywords.Add("start", () => { StartCalled(); });
        //keywords.Add("repeat", () => { StartCalled(); });
        keywords.Add("demostration", () => { DemoCalled(); });
        keywords.Add("continue", () => { ContinueCalled(); });
        keywords.Add("done", () => { DoneCalled(); });

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

        Debug.Log("play audio 3");

        if (File.Exists(dataPath) == false)
        {
            var outfile = new StreamWriter(dataPath, true);
            outfile.WriteLine("Create File  " + System.DateTime.Now.ToString());
            outfile.WriteLine("------  " + System.DateTime.UtcNow.ToString());
            outfile.Close();
        }
        else
        {
            var outfile = new StreamWriter(dataPath, true);
            outfile.WriteLine("*****************************PARTICIPANT***CORRECTIVE FEEDBACK*****************************" + System.DateTime.UtcNow.ToString());
            outfile.WriteLine("****************************** system 1 with picture set 1 ************************");
            //outfile.WriteLine("------  " + sce_name.name + "  ------  " + System.DateTime.UtcNow.ToString());
            outfile.Close();
        }
    }