Beispiel #1
0
    void OnEnable()
    {
        followCameraCanvas.SetActive(true);
        controllerHelper = GameObject.Find("ControllerHelper");
        controllerHelper.SetActive(false);
        focus          = GameObject.Find("focus").GetComponent <Text>();
        worcol         = GameObject.Find("worcol").GetComponent <Text>();
        phaseText      = GameObject.Find("PhaseText").GetComponent <Text>();
        selectables    = new GameObject[6];
        selectables[0] = GameObject.Find("Blue");
        selectables[1] = GameObject.Find("Red");
        selectables[2] = GameObject.Find("Green");
        selectables[3] = GameObject.Find("Yellow");
        selectables[4] = GameObject.Find("Orange");
        selectables[5] = GameObject.Find("Purple");
        pauseTimer     = GameObject.Find("PauseTimer").GetComponent <Text>();
        numRight       = GameObject.Find("numRight").GetComponent <Text>();
        numWrong       = GameObject.Find("numWrong").GetComponent <Text>();

        pauseTimer.gameObject.SetActive(false);

        target = selectables[0];

        //subjectID = SaveInfo.GetID();
        roomIdx = SaveInfo.GetRoom();

        //language = SaveInfo.GetLanguage();
        Localize.SetCurrentLanguage(SaveInfo.GetLanguage());
        //SetArrayLanguage(language);

        stroopTaskManager = new StroopTask(SaveInfo.GetLanguage(), SaveInfo.GetID());

        //path = SaveInfo.performancePath;



        time       = startTime;
        startTime  = 5.2f;
        timeFactor = 0.2f;

        hurtPanel = GameObject.Find("Hurt");
        hurtPanel.SetActive(false);

        timer      = GameObject.Find("timer").GetComponent <Text>();
        scoreWrong = GameObject.Find("ScoreWrong").GetComponent <Text>();
        scoreRight = GameObject.Find("ScoreRight").GetComponent <Text>();
        timebar    = GameObject.Find("Timebar").GetComponent <Image>();

        trackedObject = RightController.GetComponent <SteamVR_TrackedObject>();

        head = GameObject.Find("Camera (eye)");

        //Random.InitState(subjectID);

        Debug.Log("SubjectId: " + SaveInfo.GetID() + " RoomZero");
    }
Beispiel #2
0
    void Start()
    {
        manager = GameObject.Find("Manager");
        manager.GetComponent <NextPhase>().enabled = true;
        room      = SaveInfo.GetRoom();
        subjectID = SaveInfo.GetID();
        language  = SaveInfo.GetLanguage().ToString();

        //  Debug.Log("RoomIdx: " + room);
        //  Debug.Log("SubjectID: " + subjectID);
        //  Debug.Log("Language: " + language);
    }
Beispiel #3
0
    //Listens to NextPhase.cs, Setups for all phases of test
    public void SetPhase(int phaseIdx)
    {
        SaveInfo.roomStatus.SetPhase((SaveInfo.StroopRoomPhase)phaseIdx);
        switch (phaseIdx)
        {
        case (int)SaveInfo.StroopRoomPhase.PREPARATION:
            break;

        case (int)SaveInfo.StroopRoomPhase.CONGRUENT_PRACTICE:
            SetPhasePanelsActive();
            Init();               //practice, congruent
            phaseText.GetComponent <Localize>().localizationKey = "practice";
            Localize.SetCurrentLanguage(SaveInfo.GetLanguage());
            break;

        case (int)SaveInfo.StroopRoomPhase.CONGRUENT_TRIAL:
            Init();          //trial, congruent
            phaseText.text = "";
            break;

        case (int)SaveInfo.StroopRoomPhase.RESTING_BREAK:
            SetPauseText();
            Localize.SetCurrentLanguage(SaveInfo.GetLanguage());
            Pause();
            // phaseText.text = "Pause";
            break;

        case (int)SaveInfo.StroopRoomPhase.INCONGRUENT_PRACTICE:
            SetPhasePanelsActive();
            Init();              //practice, incongruent
            phaseText.GetComponent <Localize>().localizationKey = "practice";
            Localize.SetCurrentLanguage(SaveInfo.GetLanguage());
            break;

        case (int)SaveInfo.StroopRoomPhase.INCONGRUENT_TRIAL:
            Init();         //trial, incongruent
            phaseText.text = "";
            break;

        case (int)SaveInfo.StroopRoomPhase.RESTING_RECOVERY:
            phaseText.GetComponent <Localize>().localizationKey = "end";
            Localize.SetCurrentLanguage(SaveInfo.GetLanguage());
            End();
            break;

        default:
            End();
            phaseText.text = "Default";
            break;
        }
    }
Beispiel #4
0
    private Color StringToColor(string col)
    {
        Color color = Color.black;

        string[] words = null;

        if (SaveInfo.GetLanguage().ToString() == "German")
        {
            words = colorWordsGer;
        }
        else if (SaveInfo.GetLanguage().ToString() == "English")
        {
            words = colorWordsEn;
        }
        else if (SaveInfo.GetLanguage().ToString() == "Dutch")
        {
            words = colorWordsNl;
        }

        int idx = Array.IndexOf(words, col);

        return(colors[idx]);

        /*if (SaveInfo.GetLanguage().ToString() == "German")
         * {
         *  for (int i = 0; i < colorWordsGer.Length; i++)
         *  {
         *      if (col == colorWordsGer[i])
         *      {
         *          color = colors[i];
         *          break;
         *      }
         *  }
         * }
         * else if (SaveInfo.GetLanguage().ToString() == "English")
         * {
         *  for (int i = 0; i < colorWordsEn.Length; i++)
         *  {
         *      if (col == colorWordsEn[i])
         *      {
         *          color = colors[i];
         *          break;
         *      }
         *  }
         * }
         * return color;*/
    }
Beispiel #5
0
    string taskEnglish(string focus)
    {
        string task = "";

        if (SaveInfo.GetLanguage().ToString() == "English")
        {
            task = focus;
        }
        else if (SaveInfo.GetLanguage().ToString() == "German")
        {
            if (focus == "WORT")
            {
                task = "WORD";
            }
            else
            {
                task = "COLOR";
            }
        }
        return(task);
    }
Beispiel #6
0
    private string NameInEnglish(string name)
    {
        /*string nameEn = "";
         * if (SaveInfo.GetLanguage().ToString() == "English")
         * {
         *  nameEn = name;
         * }
         * else if (SaveInfo.GetLanguage().ToString() == "German")
         * {
         *  for (int i = 0; i < colorWordsGer.Length; i++)
         *  {
         *      if (name == colorWordsGer[i])
         *      {
         *          nameEn = colorWordsEn[i];
         *          break;
         *      }
         *  }
         * }
         * return nameEn;*/


        string[] words = null;

        if (SaveInfo.GetLanguage().ToString() == "German")
        {
            words = colorWordsGer;
        }
        else if (SaveInfo.GetLanguage().ToString() == "English")
        {
            return(name);
        }
        else if (SaveInfo.GetLanguage().ToString() == "Dutch")
        {
            words = colorWordsNl;
        }

        int idx = Array.IndexOf(words, name);

        return(colorWordsEn[idx]);
    }
Beispiel #7
0
    void OnEnable()
    {
        followCameraCanvas.SetActive(true);
        controllerHelper = GameObject.Find("ControllerHelper");
        controllerHelper.SetActive(false);
        focus          = GameObject.Find("focus").GetComponent <Text>();
        worcol         = GameObject.Find("worcol").GetComponent <Text>();
        phaseText      = GameObject.Find("PhaseText").GetComponent <Text>();
        selectables    = new GameObject[6];
        selectables[0] = GameObject.Find("Blue");
        selectables[1] = GameObject.Find("Red");
        selectables[2] = GameObject.Find("Green");
        selectables[3] = GameObject.Find("Yellow");
        selectables[4] = GameObject.Find("Orange");
        selectables[5] = GameObject.Find("Purple");
        pauseTimer     = GameObject.Find("PauseTimer").GetComponent <Text>();
        numRight       = GameObject.Find("numRight").GetComponent <Text>();
        numWrong       = GameObject.Find("numWrong").GetComponent <Text>();

        pauseTimer.gameObject.SetActive(false);

        target = selectables[0];

        //subjectID = SaveInfo.GetID();
        roomIdx = SaveInfo.GetRoom();

        Localize.SetCurrentLanguage(SaveInfo.GetLanguage());

        stroopTaskManager = new StroopTask(SaveInfo.GetLanguage(), SaveInfo.GetID());


        time       = startTime;
        startTime  = 5.2f;
        timeFactor = 0.2f;

        hurtPanel = GameObject.Find("Hurt");
        hurtPanel.SetActive(false);

        timer      = GameObject.Find("timer").GetComponent <Text>();
        scoreWrong = GameObject.Find("ScoreWrong").GetComponent <Text>();
        scoreRight = GameObject.Find("ScoreRight").GetComponent <Text>();
        timebar    = GameObject.Find("Timebar").GetComponent <Image>();

        //RoomA Variables
        minTime      = 3.0f;
        lessTime     = 0.5f;
        countStimuli = 0;


        //RoomB Variables
        room       = GameObject.Find("Walls");
        colorWalls = GameObject.Find("Selectables");
        //  ceiling = GameObject.Find("Ceiling");



        scaleWalls = 1.0f;
        //  ceilingHeight = ceiling.transform.position.y;
        minScale = 0.2f;
        //  minHeight = ceilingHeight * 0.5f;
        scaleFactorWalls = (scaleWalls - minScale) / 4.0f;
        // ceilingHeightFactor = (ceilingHeight - minHeight) / 4.0f;
        //  ceilingHeightFactor = 0.0f;


        //   Debug.Log("OnEnable: ceiligHeight: " + ceilingHeight + ", ceilingHeightFactor: " + ceilingHeightFactor);

        head          = GameObject.Find("Camera (eye)");
        trackedObject = RightController.GetComponent <SteamVR_TrackedObject>();

        //Random.InitState(subjectID);

        Debug.Log("SubjectId: " + SaveInfo.GetID() + "RoomB");
    }