Coder Social home page Coder Social logo

avatarchik / eye-tracking-2d Goto Github PK

View Code? Open in Web Editor NEW

This project forked from occularflow/eye-tracking-2d

0.0 1.0 0.0 1.83 MB

This is a Unity Asset that can be used with the 'Tobii Eye Tracking SDK' Unity Store Asset to enable eye tracking on 2D game objects.

License: MIT License

C# 100.00%

eye-tracking-2d's Introduction

Eye Tracking 2D

You can either copy the folder Assets/Assets/Scripts to your own project or download this folder and open it in Unity.

This asset requires the 'Tobii Eye Tracking SDK' asset and relevant eye tracking hardware.

The example scene shows a square that will change colours when gazing at it.

To enable a 2D game object to become eye tracking compatible, you will need a Collider2D component added to the GameObject.
A script must be created which has a class which inherits the IGazeableObject interface. This interface has the following methods:
- gazeAction()      This method is called when the user has successfully gazed at the object for longer amount than the gazeTime
- startedGazing()   This method is called when the user starts to gaze at an object - good for implementing visual feedback for the user
- stoppedGazing()   This method is called when the user looks away from an object after they have started gazing at it
- getGazeTime()     This should return the time that the user has to look at the GameObject for in order to register a successful gazeAction.

Once this script has been created, add it to your GameObject and then add the GazeableObject script to the GameObject as well.
Your GameObject can now be interacted with via eye tracking.

If you have a scene where Time.timescale is being adjusted (such as a Pause Menu where it may be set to 0), you will need to use the UniformTimeGazeableObject script instead of the GazeableObject script.

eye-tracking-2d's People

Contributors

03farhan avatar nayanadasgupta avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.