浏览代码

PR feedback: use descriptor property to avoid #ifs

/4.0
Andrew Carlston 5 年前
当前提交
f9ead36c
共有 3 个文件被更改,包括 3 次插入15 次删除
  1. 6
      Assets/Scripts/EyePoseVisualizer.cs
  2. 6
      Assets/Scripts/EyeTrackingUI.cs
  3. 6
      Assets/Scripts/FixationPoint2DVisualizer.cs

6
Assets/Scripts/EyePoseVisualizer.cs


{
var faceManager = FindObjectOfType<ARFaceManager>();
if (faceManager != null && faceManager.subsystem != null &&
#if UNITY_2020_2_OR_NEWER
faceManager.subsystem.subsystemDescriptor.supportsEyeTracking)
#else
faceManager.subsystem.SubsystemDescriptor.supportsEyeTracking)
#endif
faceManager.descriptor.supportsEyeTracking)
{
m_FaceSubsystem = (XRFaceSubsystem)faceManager.subsystem;
SetVisible((m_Face.trackingState == TrackingState.Tracking) && (ARSession.state > ARSessionState.Ready));

6
Assets/Scripts/EyeTrackingUI.cs


m_Manager = FindObjectOfType<ARFaceManager>();
}
if (m_Manager != null && m_Manager.subsystem != null &&
#if UNITY_2020_2_OR_NEWER
m_Manager.subsystem.subsystemDescriptor.supportsEyeTracking)
#else
m_Manager.subsystem.SubsystemDescriptor.supportsEyeTracking)
#endif
m_Manager.descriptor.supportsEyeTracking)
{
var infoGO = GetComponent<Text>();
infoGO.text = "This device supports eye tracking.";

6
Assets/Scripts/FixationPoint2DVisualizer.cs


{
var faceManager = FindObjectOfType<ARFaceManager>();
if (faceManager != null && faceManager.subsystem != null &&
#if UNITY_2020_2_OR_NEWER
faceManager.subsystem.subsystemDescriptor.supportsEyeTracking)
#else
faceManager.subsystem.SubsystemDescriptor.supportsEyeTracking)
#endif
faceManager.descriptor.supportsEyeTracking)
{
m_FaceSubsystem = (XRFaceSubsystem)faceManager.subsystem;
SetVisible((m_Face.trackingState == TrackingState.Tracking) && (ARSession.state > ARSessionState.Ready));

正在加载...
取消
保存