I’m creating a multiplatform videogame and want to detect between VR or cellphone for it to show the right interface, but the problem I’m having is that Oculus uses the Android build and when I try to use the RuntimePlatform.Android it doesn’t work correctly.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class GamePlatform : MonoBehaviour
{
[SerializeField]private Canvas _canvas;
void Start()
{
if (Application.platform == RuntimePlatform.Android) _canvas.renderMode = RenderMode.ScreenSpaceOverlay;
if (Application.platform == RuntimePlatform.IPhonePlayer) _canvas.renderMode = RenderMode.ScreenSpaceOverlay;
if (Application.platform == RuntimePlatform.WebGLPlayer) _canvas.renderMode = RenderMode.WorldSpace;
}
}
Is there any other way I can detect Oculus VR or how can I apply RuntimePlatform in this case?