// Use this for initialization void Start() { if (EVENT_MARKER_TYPE == LSL_EVENT_MARKER) { info = new liblsl.StreamInfo("Unity_Event_Marker", "Markers", 1, 0, liblsl.channel_format_t.cf_string, "msi"); outlet = new liblsl.StreamOutlet(info); } var stimulusManagerObject = GameObject.Find("Stimulus Manager"); stimulusManager = stimulusManagerObject.GetComponent <StimulusManager>(); var textUpdaterObject = GameObject.Find("Text Updater"); textUpdater = textUpdaterObject.GetComponent <TextUpdater>(); textUpdater.setText("Welcome"); //Shuffle(conditions); orders = new int[TARGET_NUM]; for (int i = 0; i < TARGET_NUM; ++i) { orders[i] = i; } Shuffle(orders); state = 5; }
// Use this for initialization void Start() { filename = "tmp.jpg"; filePath = System.IO.Path.Combine(Application.persistentDataPath, filename); Resolution cameraResolution = PhotoCapture.SupportedResolutions.OrderByDescending((res) => res.width * res.height).First(); targetTexture = new Texture2D(cameraResolution.width, cameraResolution.height); // Create a PhotoCapture object var stimulusManagerObject = GameObject.Find("Stimulus Manager"); stimulusManager = stimulusManagerObject.GetComponent <StimulusManager>(); targetTime = 1f; state = 0; PhotoCapture.CreateAsync(false, delegate(PhotoCapture captureObject) { photoCaptureObject = captureObject; CameraParameters cameraParameters = new CameraParameters(); cameraParameters.hologramOpacity = 0.0f; cameraParameters.cameraResolutionWidth = cameraResolution.width; cameraParameters.cameraResolutionHeight = cameraResolution.height; cameraParameters.pixelFormat = CapturePixelFormat.BGRA32; // Activate the camera photoCaptureObject.StartPhotoModeAsync(cameraParameters, delegate(PhotoCapture.PhotoCaptureResult result) { // Take a picture //photoCaptureObject.TakePhotoAsync(OnCapturedPhotoToMemory); //photoCaptureObject.TakePhotoAsync(filePath, PhotoCaptureFileOutputFormat.JPG, OnCapturedPhotoToDisk); }); }); }
void Start() { targetTime = 2f; state = 0; trainingTarget = 0; var soundManager = GameObject.Find("Audio Manager"); textToSpeech = soundManager.GetComponent <TextToSpeech>(); textToSpeech.Voice = TextToSpeechVoice.Zira; textToSpeech.StartSpeaking("Hello, welcome to the Steady State Visually Evoked Potential experiment!"); var stimulusManagerObject = GameObject.Find("Stimulus Manager"); stimulusManager = stimulusManagerObject.GetComponent <StimulusManager>(); //stimulusManager.InitialTargets(numPerColumn, numPerRow, -1.5f, 7f, 8f, 1f); stimulusManager.InitialTargets(numPerColumn, numPerRow, 0f, 0f, 8f, 1f); }