I am creating a game that is multiplatform but I need to detect if the game is being played on VR or Cellphone and if the cellphone is Samsung, Neffos or other, so it will show the right interface, the problem is that VR and all Android uses Android build and I was using RuntimePlatform.Android code to detect the cellphone.
I looked on the internet and found something that Application. would work to know this but I don’t know how to implement it.
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 and device or how can I apply RuntimePlatform in this case?