Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


activeSubsystemOrStub

The active display subsystem, if any. If no display subsystem is active, this property value references a default, stub subsystem whose members return safe values.
Read time 1 minuteLast updated 12 days ago

Definition

  • Type: Property
  • Namespace: UnityEngine.XR
  • Assembly: UnityEngine.XRModule
public static XRDisplaySubsystem activeSubsystemOrStub { get; }

Remarks

This helper property references a stub display subsystem instead of
null
when no display subsystem is active. The property is intended for use when updating obsolete APIs in the
XRDevice
and
XRStats
classes to the replacement APIs in
XRDisplaySubsystem
. You should not use this property in your own code. Instead, use the XRDisplaySubsystem.activeSubsystem property and check whether it is
null
. Explicitly checking for
null
allows you to correctly handle cases where an XR display is unavailable. In addition, the returned stub display subsystem only provides safe default values for those members needed to replace the deprecated APIs. Therefore, accessing other display subsystem members could produce unexpected results.