//Called public void BeginTrialSteps(Trial trial) { if (trial.settings.GetString("experiment_mode") == "objectToBox") { ////pseudo randomized block shapes //System.Random rando = new System.Random(); //int flag = rando.Next(100); // randomizing the shape -- this will change depending on the experiment //if (flag % 2 == 0) //even number //{ // trial.settings.SetValue("object_type", "cube"); //} //else //{ // trial.settings.SetValue("object_type", "sphere"); //} targetContainerController.IsGrabTrial = true; if (trial.settings.GetString("type") == "instruction") { // jsut wait? for a keypress? trackerHolderObject.GetComponent <PositionRotationTracker>().enabled = false; instructionAcceptor.SetActive(true); instructionAcceptorScript.doneInstruction = false; } else { trackerHolderObject.GetComponent <PositionRotationTracker>().enabled = true; // do the plane thing at the start of each block if (trial.numberInBlock == 1) { planeController.SetTilt(trial); } else { targetContainerController.SpawnTarget(trial); } } GameObject grabableObject = GameObject.FindGameObjectWithTag("ExperimentObject"); } else if (trial.settings.GetString("experiment_mode") == "target") { targetContainerController.IsGrabTrial = false; if (trial.settings.GetString("type") == "localization") { trackerHolderObject.GetComponent <PositionRotationTracker>().enabled = false; UnrenderObject(handCursor); if (GameObject.Find("RayPositionCursor") == null) { targetContainerController.SpawnTarget(trial); } } else { if (trial.settings.GetString("type") == "instruction") { // jsut wait? for a keypress? trackerHolderObject.GetComponent <PositionRotationTracker>().enabled = false; instructionAcceptor.SetActive(true); instructionAcceptorScript.doneInstruction = false; } else { RenderObject(handCursor); trackerHolderObject.GetComponent <PositionRotationTracker>().enabled = true; // do the plane thing at the start of each block if (trial.numberInBlock == 1) { planeController.SetTilt(trial); } else { targetContainerController.SpawnTarget(trial); } } } } }