Пример #1
0
    void OpenSubmenu()
    {
        // Cursor is disabled coming out of maze scenes
        Cursor.visible   = true;
        Cursor.lockState = CursorLockMode.None;

        // QUESTION: Could this be simplified? Still have to line up the right menu w/ the experiment type selected.
        FirstPanel.SetActive(false);
        if (ExperimentSettings.IsAP())
        {
            APPanel.SetActive(true);
        }
        else if (ExperimentSettings.IsSPT())
        {
            SPTPanel.SetActive(true);
        }
        else if (ExperimentSettings.IsTP())
        {
            TPPanel.SetActive(true);
        }
        else if (ExperimentSettings.IsCM())
        {
            CMPanel.SetActive(true);
        }
    }
Пример #2
0
    static private string NameImageFile()
    {
        ExperimentSettings _expInstance  = ExperimentSettings.GetInstance();
        string             imageFileName = _expInstance.FileName + "_" + _expInstance.MazeSettings.TrialName + _expInstance.TrialTracker[_expInstance.MazeSettings.TrialName].ToString() + "_";

        if (ExperimentSettings.IsAP() ||
            ExperimentSettings.IsSPT() ||
            ExperimentSettings.IsTP())
        {
            if (_expInstance.MazeSettings.Arrows)
            {
                imageFileName += "Arrows_";
            }
        }
        if (ExperimentSettings.IsCM())
        {
            imageFileName += "Start" + _expInstance.MazeSettings.StartLocationCM + "-";
            if (!string.IsNullOrEmpty(_expInstance.MazeSettings.LandmarkGoalCM))
            {
                imageFileName += "Landmark" + _expInstance.MazeSettings.LandmarkGoalCM;
            }
        }

        imageFileName += "_path.png";

        return(imageFileName);
    }
Пример #3
0
    static private List <string> GetExperimentInfo()
    {
        List <string>      experimentInfo = new List <string>();
        ExperimentSettings _expInstance   = ExperimentSettings.GetInstance();


        experimentInfo.Add(_expInstance.MazeSettings.TrialName + _expInstance.TrialTracker[_expInstance.MazeSettings.TrialName].ToString());
        experimentInfo.Add("Maze: " + _expInstance.MazeSettings.MazeName.ToString());
        experimentInfo.Add("Trial Number: " + _expInstance.TrialTracker[_expInstance.MazeSettings.TrialName].ToString());
        experimentInfo.Add("Experiment Type: " + _expInstance.ExperimentType);


        if (ExperimentSettings.IsAP() ||
            ExperimentSettings.IsSPT() ||
            ExperimentSettings.IsTP())
        {
            experimentInfo.Add("Arrows: " + _expInstance.MazeSettings.Arrows.ToString());
        }

        if (ExperimentSettings.IsCM())
        {
            experimentInfo.Add("CM Start Location: " + _expInstance.MazeSettings.StartLocationCM);
            if (!string.IsNullOrEmpty(_expInstance.MazeSettings.StartLocationCM))
            {
                experimentInfo.Add("CM Landmark:" + _expInstance.MazeSettings.LandmarkGoalCM);
            }
        }

        experimentInfo.Add("Distance: " + totalDistance);
        experimentInfo.Add("Time: " + totalTime);
        experimentInfo.Add("Avg. Velocity: " + avgVelocity);
        if (_expInstance.MazeSettings.ReachedEnd && _expInstance.MazeSettings.MazeName != MazeNameEnum.JP)
        {
            experimentInfo.Add("Reached End: " + _expInstance.MazeSettings.ReachedEnd.ToString());
        }
        else if (!_expInstance.MazeSettings.ReachedEnd && _expInstance.MazeSettings.MazeName != MazeNameEnum.JP)
        {
            experimentInfo.Add("Reached End: False, manual exit");
        }
        experimentInfo.Add("\r\n");


        return(experimentInfo);
    }
Пример #4
0
    public void InitMaze()
    {
        if (_expInstance.MazeSettings.MazeName == MazeNameEnum.JP)
        {
            Instantiate(player, startLoc.transform);
        }

        else if (_expInstance.MazeSettings.MazeName == MazeNameEnum.VME)
        {
            Instantiate(player, startLoc.transform);
            endHall.AddComponent <End> ();
            text.text = "Please navigate to the end of the hall as quickly as possible\r\n\r\n Hit the spacebar to begin.";
        }

        // Load AP, SPT, TP conditions
        else if (ExperimentSettings.IsAP() || ExperimentSettings.IsSPT() || ExperimentSettings.IsTP())
        {
            if (_expInstance.MazeSettings.Arrows)
            {
                text.text = "Please follow the arrows.\r\n\r\nHit the spacebar to begin.";
                arrows.SetActive(true);
            }
            else if (!_expInstance.MazeSettings.Arrows &&
                     _expInstance.MazeSettings.MazeName != MazeNameEnum.JP &&
                     _expInstance.MazeSettings.MazeName != MazeNameEnum.VME)
            {
                text.text = "Please recreate the route.\r\n\r\nHit the spacebar to begin.";
                arrows.SetActive(false);
            }

            if (ExperimentSettings.IsTP() &&
                (_expInstance.MazeSettings.SingleIntro || _expInstance.MazeSettings.MultiIntro))
            {
                text.text = "Please try to remember the order and turn direction.\r\n\r\nHit the spacebar to begin.";
            }

            if (_expInstance.MazeSettings.Reverse)
            {
                Instantiate(player, endLoc.transform);
                startHall.AddComponent <End> ();
            }
            else
            {
                Instantiate(player, startLoc.transform);
                if (_expInstance.MazeSettings.MazeName != MazeNameEnum.JP)
                {
                    endHall.AddComponent <End> ();
                }
            }
        }

        // Load CM conditions
        if (_expInstance.ExperimentType == ExperimentTypeEnum.CM)
        {
            if (_expInstance.MazeSettings.MazeName == MazeNameEnum.TP)
            {
                Instantiate(player, startLoc.transform);
                Debug.Log(_expInstance.MazeSettings.LandmarkGoalCM);
                if (!string.IsNullOrEmpty(_expInstance.MazeSettings.LandmarkGoalCM))
                {
                    landmarks [0].AddComponent <End> ();
                    text.text = "Please locate the landmark.\r\n\r\nHit the spacebar to begin.";
                }
                else
                {
                    text.text = "Please explore the environment.\r\n\r\nHit the spacebar to begin.";
                }
            }

            else if (_expInstance.MazeSettings.MazeName == MazeNameEnum.CM)
            {
                Debug.Log(_expInstance.MazeSettings.StartLocationCM);
                GameObject startLoc = GameObject.Find(_expInstance.MazeSettings.StartLocationCM);
                Debug.Log(startLoc);
                Instantiate(player, startLoc.transform);
                if (!string.IsNullOrEmpty(_expInstance.MazeSettings.LandmarkGoalCM))
                {
                    string     landmarkName = _expInstance.MazeSettings.LandmarkGoalCM;
                    GameObject landmark     = GameObject.Find(landmarkName);
                    GameObject colliderObj  = landmark.transform.GetChild(0).gameObject;
                    colliderObj.AddComponent <End> ();
                    text.text = "Please locate the landmark.\r\n\r\nHit the spacebar to begin.";
                }
                else
                {
                    text.text = "Please explore the environment.\r\n\r\nHit the spacebar to begin.";
                }
            }
        }
    }