您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
31 行
899 B
31 行
899 B
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using Text = UnityEngine.UI.Text;
|
|
using UnityEngine.XR.ARFoundation;
|
|
using UnityEngine.XR.ARSubsystems;
|
|
|
|
[RequireComponent(typeof(Text))]
|
|
public class EyeTrackingUI : MonoBehaviour
|
|
{
|
|
[SerializeField]
|
|
ARFaceManager m_Manager;
|
|
|
|
void OnEnable()
|
|
{
|
|
if (m_Manager == null)
|
|
{
|
|
m_Manager = FindObjectOfType<ARFaceManager>();
|
|
}
|
|
if (m_Manager != null && m_Manager.subsystem != null && m_Manager.subsystem.SubsystemDescriptor.supportsEyeTracking)
|
|
{
|
|
var infoGO = GetComponent<Text>();
|
|
infoGO.text = "This device supports eye tracking.";
|
|
}
|
|
else
|
|
{
|
|
var infoGO = GetComponent<Text>();
|
|
infoGO.text = "This device does not support eye tracking.";
|
|
}
|
|
}
|
|
}
|