public void Start() { // Access the createDotMotionScript createDotMotion = GetComponent <CreateDotMotion>(); lastTrial = false; /* * // Get the distractor and targets trackers * targetController = target.GetComponent<TargetController>(); * distractorController = distractor.GetComponent<DistractorController>(); */ }
//public Tracker distractorTracker; void Start() { // Get session experiment = GameObject.FindGameObjectWithTag("Experiment"); experimentGenerator = experiment.GetComponent <ExperimentGenerator>(); distSession = experimentGenerator.session; // Get the direction of the stimulus dots and go the opposite way createDotMotion = experiment.GetComponent <CreateDotMotion>(); combinedDirection = createDotMotion.combined_direction; // Set the direction and speed the distractor moveSpeed = distSession.settings.GetInt("distractorMoveSpeed"); transform.Rotate(90f, 0f, 0f); if (combinedDirection == "Northeast") { distDir = new Vector3(-1f, -1f, 0f); distDirection = "Southwest"; } else if (combinedDirection == "Southeast") { distDir = new Vector3(-1f, 1f, 0f); distDirection = "Northwest"; } else if (combinedDirection == "Northwest") { distDir = new Vector3(1f, -1f, 0f); distDirection = "Southeast"; } else { distDir = new Vector3(1f, 1f, 0f); distDirection = "Northeast"; } // Log distractor direction distSession.CurrentTrial.result["distractor_direction"] = distDirection; /* * // Add a tracker of its position * distSession.trackedObjects.Add(distractorTracker); * distractorTracker.StartRecording(); */ }
void Start() { // Get session experiment = GameObject.FindGameObjectWithTag("Experiment"); experimentGenerator = experiment.GetComponent <ExperimentGenerator>(); targetSession = experimentGenerator.session; // Get the direction of the stimulus dots createDotMotion = experiment.GetComponent <CreateDotMotion>(); combinedDirection = createDotMotion.combined_direction; targetSession.CurrentTrial.result["target_direction"] = combinedDirection; // Set the direction and speed the target moveSpeed = targetSession.settings.GetInt("targetMoveSpeed"); transform.Rotate(90f, 0f, 0f); if (combinedDirection == "Northeast") { targetDir = new Vector3(1f, 1f, 0f); } else if (combinedDirection == "Southeast") { targetDir = new Vector3(1f, -1f, 0f); } else if (combinedDirection == "Northwest") { targetDir = new Vector3(-1f, 1f, 0f); } else { targetDir = new Vector3(-1f, -1f, 0f); } /* * // Add a tracker of its position * targetSession.trackedObjects.Add(targetTracker); * targetTracker.StartRecording(); */ }
public void Awake() { // Added by Aislinn to get session experiment = GameObject.FindGameObjectWithTag("Experiment"); experimentGenerator = experiment.GetComponent <ExperimentGenerator>(); dotSession = experimentGenerator.session; // Added by Aislinn to change angle with difficulty createDotMotion = experiment.GetComponent <CreateDotMotion>(); currentLevel = createDotMotion.level; /* * //stim_direction = Random.Range(0, 2); * if (stim_directionH == 0 && stim_directionV == 0) * { * combined_direction = "Northeast"; * } * if (stim_directionH == 0 && stim_directionV == 1) * { * combined_direction = "Southeast"; * } * if (stim_directionH == 1 && stim_directionV == 0) * { * combined_direction = "Northwest"; * } * if (stim_directionH == 1 && stim_directionV == 1) * { * combined_direction = "Southwest"; * } */ // Added by Aislinn to get the dots to go in a tangential direction stimLocList = dotSession.settings.GetIntList("stimulusLocation"); if (stimLocList[1] == 45) { stimPosSt = "upperRight"; } else if (stimLocList[1] == 135) { stimPosSt = "lowerRight"; } else if (stimLocList[1] == 225) { stimPosSt = "lowerLeft"; } else { stimPosSt = "upperLeft"; } stim_direction = Random.Range(0, 2); if (stimPosSt == "upperRight") { if (stim_direction == 0) { combined_direction = "Northwest"; stim_directionH = 1; stim_directionV = 0; } else { combined_direction = "Southeast"; stim_directionH = 0; stim_directionV = 1; } } else if (stimPosSt == "lowerRight") { if (stim_direction == 0) { combined_direction = "Northeast"; stim_directionH = 0; stim_directionV = 0; } else { combined_direction = "Southwest"; stim_directionH = 1; stim_directionV = 1; } } else if (stimPosSt == "lowerLeft") { if (stim_direction == 0) { combined_direction = "Northwest"; stim_directionH = 1; stim_directionV = 0; } else { combined_direction = "Southeast"; stim_directionH = 0; stim_directionV = 1; } } else { if (stim_direction == 0) { combined_direction = "Northeast"; stim_directionH = 0; stim_directionV = 0; } else { combined_direction = "Southwest"; stim_directionH = 1; stim_directionV = 1; } } }