viewport
7 years agoProtege
Why can't I Initialise Oculus on Gear VR
I am trying to perform an entitlement check.
Nothing at all runs in the script after the Oculus.Platform.Core.AsyncInitialize(); not even update.
I have tried on a version downloaded from the store in the Release Channel.
No errors are caught.
Running on Gear VR doesn't.
The script works fine on PC.
using System.Collections;
Nothing at all runs in the script after the Oculus.Platform.Core.AsyncInitialize(); not even update.
I have tried on a version downloaded from the store in the Release Channel.
No errors are caught.
Running on Gear VR doesn't.
The script works fine on PC.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Oculus.Platform;
public class OculusEntitlmentCheck : MonoBehaviour
{
public TextMesh debugText;
public TextMesh debugText2;
void Awake()
{
debugText.text = "entitlementCheckScriptAwake";
if (OculusDeviceToggle.isRunningOnOculus)
{
debugText.text = "checking entitlment";
try
{
debugText.text = "initializing oculus 1";
Oculus.Platform.Core.AsyncInitialize();
debugText.text = "initializing oculus 2";
Entitlements.IsUserEntitledToApplication().OnComplete(GetEntitlmentCallback);
debugText.text = "initializing oculus 3";
}
catch (UnityException e)
{
debugText.text = "oculus initialisation failed";
Debug.LogException(e);
Quit();
}
}
}
void GetEntitlmentCallback(Message msg)
{
if(msg.IsError)
{
Debug.LogError("You are NOT entitled to use this app.");
Quit();
}
else
{
debugText.text = "you are entitled to this app";
}
}
void Quit()
{
debugText.text = "Quit function running";
UnityEngine.Application.Quit();
}
}