I have gone through the documentation and I have written the below code to get the gaze vector and display it on a text on the screen. But it doesn't work, it throws an error:
PXRLog Failed at GetEyeTrackingDevice devices.Count
The code I have written is:
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using Unity.XR.PXR;
public class EyeRecord : MonoBehaviour
{
public Text textElement;
public static List<Vector3> eyeGazeDirectionList = new List<Vector3>();
// Start is called before the first frame update
void Start()
{
if (PXR_Manager.Instance.eyeTracking)
{
Debug.Log("Eye tracking instance found");
}
else
{
Debug.Log("Eye tracking instance not found");
}
}
// Update is called once per frame
void Update()
{
PXR_EyeTracking.GetCombineEyeGazeVector(out Vector3 eyeGazeDirection);
eyeGazeDirectionList.Add(eyeGazeDirection);
textElement.text = eyeGazeDirection.ToString("F1");
}
}
I have added the PXR_Manager to the XRrig and enabled the eye-tracking component as shown below:

Unity v. 2019.4.38f1
PICO XR SDK 2.0.4
PUI v4.6.3