Documentation‎ > ‎Scripts‎ > ‎Standard Assets‎ > ‎


  • This script is in charge of communicating with the EyeLink eyetracker. To do this, it makes use of a C code DLL we created using VisualStudio to interface with the EyeLink API. (We couldn't interface directly because some EyeLink data types aren't recognized by Unity.) 
  • This script first receives output from the eyetracker (eye position in the form of saccade endpoints) to be used in scripts that recognize saccades to targets (i.e. GetScreenBounds_cubby). 
  • Then it relays info from these and other scripts to the EEG through the eye tracker's parallel port in the form of 'event codes' (specified in the Numbers script). These indirect means are used so we can compare the exact time the event was sent (we tell EyeLink to log this in the DLL) to the exact time it was received by the EEG. We can use this info in analysis to match up the EyeLink and EEG data files' timing. 
  • It can also receive the eyelink time in ms (a trusted clock), and write text (for general logging purposes) to the EDF file. 
  • This script is just the messenger - other scripts tell it what events to write. 
  • It's written in C-sharp because that language allows interfacing with Plugins, and Javascript does not. 
  • This script should be placed in the "Standard Assets" folder because Javascript functions can only reference C-Sharp functions if they're compiled first, and the Standard Assets folder is compiled before the rest of the project. 
  • See the Unity Scripting manual's page on Plugins for more info on DLLs. 
  • NOTE: There is a "debug" version at the bottom of this script... comment this version ("public class eyelink:...") and uncomment that one if you don't have a connection to the eyelink computer. 

- Created ~5/2010 by DJ.
- Updated 10/30/13 by DJ - added sample_eye from dll and UpdateEye_raw as wrapper for it
- Updated 11/7/13 by DJ - upgraded to wrapper 1.8, added get_fixupdate, replaced UpdateEye_raw with UpdateEye_fixupdate