Last active
December 24, 2019 13:24
-
-
Save glitchersgames/557bc2dce118221b5e3734c2e900fac9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public class OpenWebsiteOnHeadsetRemove : MonoBehaviour | |
{ | |
#region Serialized | |
public OVRManager m_OVRManager; | |
#endregion | |
#region Variables | |
private bool m_UserPresent = true; | |
private bool m_HasOpenedURL = false; | |
#endregion | |
#region Lifecycle | |
private void Update () { | |
#if UNITY_ANDROID | |
bool isUserPresent = m_OVRManager.isUserPresent; | |
if( m_UserPresent != isUserPresent ) | |
{ | |
if( isUserPresent == false && m_HasOpenedURL == false && Application.isEditor == false ) | |
{ | |
m_HasOpenedURL = true; | |
Application.OpenURL("http://www.glitchers.com"); | |
} | |
} | |
m_UserPresent = isUserPresent; | |
#endif | |
} | |
#endregion | |
} |
Hey glitchersgames, I am trying to open a url from gear vr app, but clicking on the button that is registered to application.openurl does nothing when doing from the Gear VR headset. But it works perfectly fine if I turn on the VR developer settings from the mobile and run the app without inserting it into the headset. Do you know what else can I do? It doesn't freeze the app but does nothing instead when done with the headset
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Calling Application.OpenURL in OnApplicationQuit works well. I've had different degrees of success with each.