public void EvaluateReponse() { //Time stamp taken when button is pressed RTstamp = (DateTime.Now.Ticks / TimeSpan.TicksPerMillisecond); //calculate Response Time ResponseTime = Convert.ToInt32(RTstamp - _taskEngine.StimTime); //saving reponse times _responseTimes.Add(ResponseTime); switch (_taskEngine.CurrentBlockType) { #region TrialBlock //respond to zeros case BlockType.TrialBlock: //stimulus constraint if (_taskEngine.StimCode == 0) { CurrentResponseEval = ResponseEval.HIT; _hitFlag = 1; } else if (_taskEngine.StimCode != 0) { CurrentResponseEval = ResponseEval.FAL; _falseAlarmFlag = 1; } break; #endregion } if (_hitFlag == 1) { HitCount++; _hitFlag = 0; } if (_falseAlarmFlag == 1) { FalseAlarmCount++; _falseAlarmFlag = 0; } if (_timeErrorFlag == 1) { TimeErrorCount++; _timeErrorFlag = 0; } Debug.Log(_taskEngine.StimCode + " " + CurrentResponseEval + " " + ResponseTime); }
// Use this for initialization void Awake() { _taskEngine = FindObjectOfType <TaskEngine>(); CurrentResponseEval = ResponseEval.Init; }