// Update is called once per frame void NewParticipantListener() { participantID.text = ps.GetParticipantAsString(); ps.ConditionFromParticipant(); ParticipantStatus.Condition cond = ps.GetCondition(); cubeset.text = cond.cubeset.ToString(); arrangement.text = cond.catmap.ToString(); }
// in order for this to work we need an EventSystem component void SetParticipantCondition() { ps.SetCondition(int.Parse(cubeset.text), int.Parse(arrangement.text)).BuildParticipantFromCondition(); if (ps.GetParticipant() > 0) { Debug.Log("condition " + ps.GetCondition() + " for " + ps.GetParticipant()); SceneManager.LoadScene(NextScene, LoadSceneMode.Single); } }
// in order for this to work we need an EventSystem component void SetParticipantCondition() { ps.SetCondition(int.Parse(cubeset.text), int.Parse(arrangement.text)).BuildParticipantFromCondition(); if (ps.GetParticipant() > 0) { menu.SetActive(false); controInfo.SetActive(true); Debug.Log("condition " + ps.GetCondition() + " for " + ps.GetParticipant()); } }
void PreviousParticipantListener() { if (ps.GetParticipant() > 0) { participantID.text = ps.GetParticipantAsString(); ParticipantStatus.Condition cond = ps.GetCondition(); cubeset.text = cond.cubeset.ToString(); arrangement.text = cond.catmap.ToString(); } }
// in order for this to work we need an EventSystem component void StartExperimentListener() { if (ps.GetParticipant() > 0) { Debug.Log("Starting experiment: condition " + ps.GetCondition() + " for " + ps.GetParticipant()); if (NextScene != null && NextScene != "") { SceneManager.LoadScene(NextScene, LoadSceneMode.Single); } } }
public DataFarmerObject(string tag) { this.tag = tag; this.timestamp = Time.time; ps = ParticipantStatus.GetInstance(); this.participant = ps.GetParticipant(); this.trial = ps.GetTrial(); this.condition = ps.GetCondition(); this.category = ps.GetCategory(); this.cube = ps.GetCube(); }
// Update is called once per frame public void Update() { GameObject cube = GameObject.FindGameObjectWithTag("Interactable Object"); if (player != null && cube != null) { if (cube != null) { Transform transform = cube.GetComponent <Transform>(); int[] angles = { (int)Math.Abs(Math.Round(Vector3.Angle(player.transform.forward, transform.right)) - 90.0), (int)Math.Abs(Math.Round(Vector3.Angle(player.transform.forward, transform.up)) - 90.0), (int)Math.Abs(Math.Round(Vector3.Angle(player.transform.forward, transform.forward)) - 90.0), }; int max = angles.Max(); int visibleSide = NOSIDE; // basic idea: is the cube face angled towards us enough for us to see it? // we also want to check if the player's head is rotated up or to the side too far if (max > thresholdAngle) { visibleSide = angles.ToList().IndexOf(max); } bool publishUpdate = false; if (ps.GetTrial() != trial) { trial = ps.GetTrial(); publishUpdate = true; } else { if (visibleSide != previousSide) { publishUpdate = true; } } if (publishUpdate) { // the last Vector3 is a placeholder for the cumulative movement of the head and hand controllers DataFarmer.GetInstance().Save( new DFFixation( "up=" + angles[UP], "forward=" + angles[FORWARD], "right=" + angles[RIGHT], dirStrings[visibleSide], ps.DisplacementsToString() ) ); previousSide = visibleSide; } if (detailedLogging && measurements % 20 == 0) { angleDisplay.text = "participant " + ps.GetParticipantAsString() + " condition " + ps.GetCondition().ToString() + "\n" + "right " + player.transform.forward[RIGHT] + " up " + player.transform.forward[UP] + "\n" + dirStrings[UP] + " " + angles[UP] + ", " + dirStrings[RIGHT] + " " + angles[RIGHT] + ", " + dirStrings[FORWARD] + " " + angles[FORWARD] + "\n" + dirStrings[visibleSide] + " is facing you" + "\n" + "correct answer is " + ps.GetCategory(); } ; measurements++; } } }