Example #1
0
    void Look()
    {
        Vector3 olhando;
        Ray     ray;

        if ((!TobiiAPI.GetDisplayInfo().IsValid) || (!TobiiAPI.GetUserPresence().IsUserPresent()))
        {
            ray = Camera.main.ScreenPointToRay(Input.mousePosition);
        }
        else
        {
            olhando = new Vector3(TobiiAPI.GetGazePoint().Screen.x, TobiiAPI.GetGazePoint().Screen.y, 0f);
            ray     = Camera.main.ScreenPointToRay(olhando);
            //se tiver eyetracker, mas quiser pausar porque perdeu os olhos, fazer akie

            /*if (TobiiAPI.GetDisplayInfo ().IsValid) {
             *                  Debug.Log ("Seus olhos não podem ser detectados");
             *          }*/
        }
        if (seekMouse)
        {
            gameObject.transform.rotation = Quaternion.LookRotation(ray.direction);
        }
        else
        {
            gameObject.transform.rotation = Camera.main.transform.rotation;
        }
    }
Example #2
0
    void Start()
    {
        //Debug.Log("Screen Width: " + Screen.width + "Screen Height: " + Screen.height);
        if (PlayerPrefs.GetInt("Game_1_ET_Enabled") > 0)
        {
            isEyeTrackingEnabled = true;
        }
        else
        {
            isEyeTrackingEnabled = false;
        }

        charController      = GetComponent <CharacterController>();
        screenCenter        = new Vector2(Screen.width / 2, Screen.height / 2);
        eyeHorizontalFactor = eyeVerticalFactor = 0;
        DisplayInfo display = TobiiAPI.GetDisplayInfo();

        audioPlayer = GetComponent <AudioSource>();
    }