Version: Unity 6.5 Alpha (6000.5)
LanguageEnglish
  • C#

XRDisplaySubsystem.activeSubsystemOrStub

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

public static XR.XRDisplaySubsystem activeSubsystemOrStub;

Description

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.

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 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.