I'm looking for a way to detect the name of the headset being used in my VR app. I need to distinguish between the Quest 1 & 2 in order to implement the different controller meshes/skins. I have searched here, this is similar Detect Oculus Quest 1 & 2 Headsets in Unity but uses the OVRPlugin which is not available with the XR Interaction Toolkit installed (is it?) Any help would be appreciated.
Edit: or perhaps this?: https://docs.unity3d.com/ScriptReference/SystemInfo.html
I had a similar problem. I wanted to check if Quest 2 is tethered or standalone. I did something like this. I am sure you can run it on your Quest 1 device and adjust to do the needful on that device.
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.XR;
public class CheckDeviceType : MonoBehaviour
{
void Start()
{
Debug.Log("operatingSystem: " + SystemInfo.operatingSystem);
Debug.Log("deviceModel: " + SystemInfo.deviceModel);
Debug.Log("deviceName: " + SystemInfo.deviceName);
Debug.Log("deviceType: " + SystemInfo.deviceType);
Debug.Log("platform: " + Application.platform);
var devices = new List<InputDevice>();
InputDevices.GetDevices(devices) ;
foreach (var device in devices)
{
Debug.Log("Device connected: " +device.name);
}
if (SystemInfo.deviceName == "Oculus Quest 2")
DoNeededCode(); // Standalone Quest 2
}
}
The output will be like this for Quest 2 standalone in Android Studio Logcat:
I/Unity: operatingSystem: Android OS 10 / API-29 (QQ3A.200805.001/19130100154900000)
I/Unity: deviceModel: Oculus Quest
I/Unity: deviceName: Oculus Quest 2
I/Unity: deviceType: Handheld
I/Unity: platform: Android
I/Unity: Device connected: Oculus Quest
I/Unity: Device connected: Oculus Touch Controller - Left
I/Unity: Device connected: Oculus Touch Controller - Right
And like this in Unity Editor on Windows: