예제 #1
0
 // Update is called once per frame
 void Update()
 {
     //TODO: if easy mode, else do nothing
     if (currentRoom > 0)
     {
         spawnPoint.transform.position = spawnPointPositions [currentRoom - 1];
     }
     else
     {
         spawnPoint.transform.position = spawnPointPositions [0];
     }
     if (Input.GetKeyDown(KeyCode.M))
     {
         //EmoMentalCommand.EnableMentalCommandAction(EdkDll.IEE_MentalCommandAction_t.MC_NEUTRAL,true); //neutral doesnt need enabling
         EmoMentalCommand.StartTrainingMentalCommand(EdkDll.IEE_MentalCommandAction_t.MC_NEUTRAL); // training the neutral command
         Debug.Log("training neutral has started");
         EmoMentalCommand.trainingType = 0;                                                        //to signify that it is neutral
     }
     if (Input.GetKeyDown(KeyCode.T))                                                              //TODO and we are in room 4
     {
         if (!trainingInProgress)
         {
             onTPressed();
         }
     }
 }
예제 #2
0
    /// <summary>
    /// Initiates trainging of mental command, called by Left_Button, Right_Button, and Neutral_Button
    /// </summary>
    /// <param name="type">Command to be trained ("Neutral","Left","Right")</param>
    public void TrainAction(string type)
    {
        LoggerCSV logger = LoggerCSV.GetInstance();

        trainType = type;
        EdkDll.IEE_MentalCommandAction_t toTrain = EdkDll.IEE_MentalCommandAction_t.MC_NEUTRAL;
        cube.SetAciton(cube.ACTION_RESET);
        switch (type)
        {
        case "Left":
            toTrain = EdkDll.IEE_MentalCommandAction_t.MC_LEFT;
            logger.AddEvent(LoggerCSV.EVENT_TRAINING_L);
            break;

        case "Right":
            toTrain = EdkDll.IEE_MentalCommandAction_t.MC_RIGHT;
            logger.AddEvent(LoggerCSV.EVENT_TRAINING_R);
            break;

        default:
            logger.AddEvent(LoggerCSV.EVENT_TRAINING_N);
            break;
        }

        StartCoroutine(UI.UpdateSlider());

        EmoMentalCommand.EnableMentalCommandAction(toTrain, true);
        EmoMentalCommand.EnableMentalCommandActionsList();
        EmoMentalCommand.StartTrainingMentalCommand(toTrain);
    }
예제 #3
0
    void Update()
    {
        RaycastHit hit;

        cameraLocation  = GetComponentInChildren <Camera> ().transform.position;
        cameraDirection = GetComponentInChildren <Camera>().transform.TransformDirection(Vector3.forward);
        Ray visionRay = new Ray(cameraLocation, cameraDirection);

        Debug.DrawRay(cameraLocation, cameraDirection * 15);

        if (Physics.Raycast(visionRay, out hit, lineOfSight))
        {
            //if the object is a picture and it hasn't been completed yet
            if (hit.collider.tag == "StareTarget")             // && hit.collider.gameObject.GetComponent<MeshRenderer> ().materials [0].color == Color.red) {
            {
                if (!watching)
                {
                    watching   = true;
                    watchTimer = 0f;
                    StartCoroutine(ShowMessage("Started Watching", 1));
                }
                else                     //if you're already watching the picture, carry on with the timer
                {
                    watchTimer += Time.deltaTime;
                    Debug.Log("time: " + watchTimer.ToString());
                    if (watchTimer == 1)
                    {
                        EmoMentalCommand.EnableMentalCommandAction(EmoMentalCommand.MentalCommandActionList[0], true);
                        EmoMentalCommand.StartTrainingMentalCommand(EmoMentalCommand.MentalCommandActionList[0]);                 // mental commandactionlist[0] is neutral, 1 is push
                    }
                    if (watchTimer >= 10)
                    {
                        StartCoroutine(ShowMessage("Completed", 1));
                        hit.collider.gameObject.GetComponent <MeshRenderer> ().materials [0].color = new Color(0f, 1f, 0f, 0.1f);                     //adds a shade of green to the picture with 0.5 alpha
                        hit.collider.gameObject.GetComponent <PictureScript>().isWatched           = true;
                    }
                    if (EmoFacialExpression.isBlink)
                    {
                        //if (Input.GetKeyDown (KeyCode.B)) {  //TODO: switch these after testing
                        StartCoroutine(ShowMessage("Don't Blink When Appreciating Art\nRestarting Timer", 2));
                        watchTimer = 0;
                    }
                    if (!EmoFacialExpression.isEyesOpen)
                    {
                        //watchTimer = 0; //reset the timer if the headset isn't on or the player closes his eyes
                    }
                }
            }
            else                 //in case vision goes to something other than the painting
            {
                watching = false;
                return;
            }
        }
    }
예제 #4
0
    /// <summary>
    /// when the button Train of posActionButton is clicked
    /// </summary>
    /// <param name="posActionButton"></param>
    void OnTrainClick(int posActionButton, int ActionID)
    {
        focusWindow = 100;
        if (!isShowProgessBar)
        {
            timeCount = Time.time;

            isShowProgessBar = true;
        }
        //StartTrainingCognitiv
        EmoMentalCommand.StartTrainingMentalCommand(EmoMentalCommand.MentalCommandActionList[ActionID]);
        Debug.Log(ActionID);
    }
예제 #5
0
    public void onTPressed()
    {
        //to ensure that the player has reached this room
        //if (currentRoom != 5) {
        //	return;
        //}
        //this slowed the code even more^

        //StartTrainingCognitiv
        EmoMentalCommand.EnableMentalCommandAction(EdkDll.IEE_MentalCommandAction_t.MC_PUSH, true);
        EmoMentalCommand.StartTrainingMentalCommand(EdkDll.IEE_MentalCommandAction_t.MC_PUSH);         // training the push command
        Debug.Log("training push has started");
        UnpushableCubeScript.moveStarted = true;
        EmoMentalCommand.trainingType    = 1;
    }
예제 #6
0
 // Update is called once per frame
 void Update()
 {
     if (Input.GetKeyUp(KeyCode.P))
     {
         EmoMentalCommand.StartTrainingMentalCommand(EdkDll.IEE_MentalCommandAction_t.MC_NEUTRAL);
     }
     if (Input.GetKeyUp(KeyCode.O))
     {
         EmoMentalCommand.StartTrainingMentalCommand(EdkDll.IEE_MentalCommandAction_t.MC_LIFT);
     }
     if (Input.GetKeyUp(KeyCode.I))
     {
         EmoMentalCommand.StartTrainingMentalCommand(EdkDll.IEE_MentalCommandAction_t.MC_PUSH);
     }
     if (Input.GetKeyUp(KeyCode.U))
     {
         EmoMentalCommand.StartTrainingMentalCommand(EdkDll.IEE_MentalCommandAction_t.MC_PULL);
     }
 }
 void OnTrainClick(int ActionID)
 {
     EmoMentalCommand.StartTrainingMentalCommand(EmoMentalCommand.MentalCommandActionList[ActionID]);
 }