public void NewFile() { m_ExpManager = this.GetComponent <ExperimentManager_Control>(); e_ExpTrial = this.GetComponent <ExpTrial_Control>(); csv = new StringBuilder(); // Start new stream writer int trialnum = m_ExpManager.trialNumber; expPath = FileName(trialnum + 1); // Write first line with data information string newLine = string.Format("{0},{1},{2},{3}", "Color", "Orientation", "X Location", "Y Location"); csv.AppendLine(newLine); }
void Start() { // Initialize script references m_ExpSetup = this.GetComponent <ExpSetup_Exp>(); m_ExpCue = this.GetComponent <ExpCue_Exp>(); m_ExpTrial = this.GetComponent <ExpTrial_Control>(); m_LocationData = this.GetComponent <LocationData_Control>(); m_ResponseData = this.GetComponent <ResponseData_Exp>(); // Find peripheral objects redPeripherals = GameObject.FindGameObjectsWithTag("RedHUD"); bluePeripherals = GameObject.FindGameObjectsWithTag("BlueHUD"); // Find photocell object pcObjectRef = GameObject.Find("Photocell"); // Find instructions object instructionsRef = GameObject.Find("Instructions"); // Setup input field references inputGameobjectRef = GameObject.Find("InputField"); inputGameobjectRef.SetActive(false); // Setup trial counter references trialCounterRef = GameObject.Find("TrialCounter"); m_TrialNumber = trialCounterRef.GetComponent <TrialNumber>(); trialCounterRef.SetActive(false); // Setup subTrialCalls bool list for (int i = 0; i < subtrialNum; i++) { subTrialCalls.Add(false); } nextSceneNum = SceneManager.GetActiveScene().buildIndex + 1; }