// Update is called once per frame void Update() { // state machine ( ステートマシンとして実装 ) if (state == stateStartAreaDisplayed) { if (startArea.ReadyForRecording()) { // set cursor parameter (config) cursor.SetCursorParameters(experimentalParameters); // 計測開始 tiltManager.startRecording(); cursor.startRecording(); state = stateRecordingStarted; } } else if (state == stateRecordingStarted) { if (startArea.ReadyForTarget()) { // activate target targetObj.SetActive(true); state = stateTargetDisplayed; } } else if (state == stateEndOfTrial) { if (Time.time - timeTargetDestroyed > timeToNextTrial) { // state state = stateOther; // destroy Destroy(startAreaObj); Destroy(gameObject); // send to ExperimentMangager experimentManager.OnTrialFinished(); } } else { } }