Exemplo n.º 1
0
    void DemoCalled()
    {
        start_called = false;//to control the start introduction, never call it again

        // if (audioSource.isPlaying) audioSource.Stop();

        //demo_called = true;

        PlayAudio(clips[2]);

        task.ShowDemos();
        //task.CreateTask(LEVEL);

        t_action = gameObject.GetComponent <TeachAction>();
        if (t_action != null)
        {
            Destroy(t_action);
        }
        ease = GameObject.Find("RH_ease_clone");
        if (ease != null)
        {
            Destroy(ease);
        }
        action.ActionTaken(1);  //#1 is teachaction which can show a demo
        //done = t_action.teachactionDone;
    }
Exemplo n.º 2
0
    void DoneCalled()
    {
        if (!no_done)
        {
            done_called  = true;
            wrongsorting = false;
            wrongscore   = 0;
            for (int i = 0; i < task.activeNum; i++)
            {
                if (dict[i].hitTarget() == false)
                {
                    wrongscore += 1;
                }
            }

            var outfile = new StreamWriter(dataPath, true);
            outfile.WriteLine("done called once at UTC time = " + System.DateTime.UtcNow.ToString() + "  wrongscore = " + wrongscore.ToString());
            outfile.Close();

            if (continue_called == true)  //use to make sure no multiple done called
            {
                continue_called = false;
                if (wrongscore > 0)
                {
                    wrongsorting = true;
                    PlayAudio(clips[5]); //agent say this is a wrong sorting
                    MoveTargHolder();
                    action.ActionTaken(2);
                    //agent execute the correct action
                    //c_action = gameObject.GetComponent<CorrectAction>();
                }
                else
                {
                    PlayAudio(clips[4]);
                    // task.taskNumber_correct += 1;

                    if (task.taskNumber_correct > 4)
                    {
                        PlayAudio(clips[6]);
                        no_demo     = true;
                        no_continue = true;
                        no_suggest  = true;
                    }
                    else
                    {
                        PlayAudio(clips[4]);
                    }
                }
            }
        }
        else
        {
            PlayAudio(clips[6]);
        }
    }