Hello everyone. I’m making an App in Unity that has VR/AR and non vr scenes. I can enable and disable the VR inside the app by using VRSettings.LoadDeviceByName however when the app starts before unity Splash screen app shows a split screen. PlayerSetting => Virtual Reality supported is checked of course when I uncheck it VR is not working as you can imagine. I’m calling VRSettings.LoadDeviceByName in an IEnumerator in the Awake Funtion. If you want I can upload the APK to a link.
Is there a way to remove the split screen at start?
Hi,
you have to choose None as the first device in the PlayerSettings Virtual Reality SDKs
Device None is equivalent to a non-VR application.
Built applications: Choosing startup device
But in my application it doesn’t work - If I set None as first device and then I switch ingame to VR, I got a very strange result…
Cheers
No I haven’t tried that let me try and get back to you thanks for the advice.
Hi crpt(). Thanks for your answer I finally figured out how to remove it thanks to you. As you mentioned I select the device type to none but then GoogleVR didn’t work at all but later I added the Cardboard sdk as an second SDK and worked like a charm. Here see the picture on how I manage the Player settings.
Also this is the code I’m using to enable and disable the VR.
Hope this will help people.
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.VR;
public class VRSceneManager : MonoBehaviour {
public static VRSceneManager instance;
void Awake()
{
enableVr();
//or
//disableVR();
}
// Use this for initialization
void Start()
{
instance = this;
}
IEnumerator LoadDevice(string newDevice, bool enable)
{
VRSettings.LoadDeviceByName(newDevice);
yield return null;
VRSettings.enabled = enable;
}
void enableVr()
{
StartCoroutine(LoadDevice("cardboard", true));
}
void disableVr()
{
StartCoroutine(LoadDevice("", false));
}
}