10-28-2016 01:02 PM
Solved! Go to Solution.
10-28-2016 02:11 PM
10-28-2016 01:37 PM
Oculus.Platform.Core.Initialize(); // Notice I took out the appID parameter, it is supplied automatically if you put it into the platform settings window
10-28-2016 02:01 PM
10-28-2016 02:11 PM
10-28-2016 02:54 PM
04-27-2017 06:40 PM
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System;
using Oculus.Platform;
using UnityEngine.SceneManagement;
public class Entitlements : MonoBehaviour {
public GameObject ErrorMsg;
public bool quitting;
void Start () {
Oculus.Platform.Core.Initialize();
}
void Update (){
CheckApplicationEntitlement ();
}
public void CheckApplicationEntitlement() {
Oculus.Platform.Entitlements.IsUserEntitledToApplication().OnComplete(callbackMethod);
}
void callbackMethod (Message msg)
{
if (!msg.IsError)
{
Debug.Log ("yep");
}
else
{
Debug.Log ("nope");
if (!quitting) {
StartCoroutine (quitApp ());
quitting = true;
}
}
}
IEnumerator quitApp ()
{
Instantiate (ErrorMsg);
yield return new WaitForSeconds (5);
UnityEngine.Application.Quit ();
Debug.Log ("hasQuit");
}
}
For the variable that turns up in the editor, make a Prefab out of (say) a worldspace canvas in front of the camera with an error message on it and drag it to 'ErrorMsg'.06-30-2017 12:36 PM
06-30-2017 02:30 PM
06-30-2017 04:39 PM
08-01-2017 03:24 AM
void Update ()
{
Oculus.Platform.Entitlements.IsUserEntitledToApplication().OnComplete(callbackMethod);
}