Our app needs to know which headset type is currently plugged in. We support Oculus, Windows MR, Vive, and Cosmos. In the past we've used Unity's XRDisplaySubsystems, and then parsed their names to determine which headset is plugged in. When we integrated the ViveInputUtility this broke, as now all of their ids are just "OpenVR Display". Is there another way to get this info out of the Vive Input Utility, or to get the old ids back? Thanks,
-Bert
Our existing code:
public static XRDisplaySubsystem GetXrSubsystem()
{
var xrDisplaySubsystems = new List<XRDisplaySubsystem>();
SubsystemManager.GetInstances<XRDisplaySubsystem>(xrDisplaySubsystems);
return xrDisplaySubsystems.FirstOrDefault();
}
public static SteamVrDevice WindowsVrDevice
{
get
{
string device = GetXrSubsystem()?.SubsystemDescriptor.id.ToLowerInvariant();
if (string.IsNullOrEmpty(device))
{
return SteamVrDevice.None;
}
if (device.Contains("oculus") || device.Contains("quest") || device.Contains("miramar"))
return SteamVrDevice.Rift;
else if (device.Contains("hp reverb") || device.Contains("samsung") || device.Contains("lenovo"))
return SteamVrDevice.WindowsMr;
else if (device.Contains("vive"))
return SteamVrDevice.Vive;
else if (device.Contains("openvr"))
return SteamVrDevice.ViveCosmos;
else
return SteamVrDevice.None;
}
}