Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@kelvinharron
Created October 27, 2017 07:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kelvinharron/1bd765cdd27600be16c95be5d97135be to your computer and use it in GitHub Desktop.
Save kelvinharron/1bd765cdd27600be16c95be5d97135be to your computer and use it in GitHub Desktop.
using UnityEngine;
using Oculus.Platform;
using Oculus.Platform.Models;
using System.Collections;
public class OculusEntitlementCheck : MonoBehaviour {
void Awake () {
Oculus.Platform.Core.AsyncInitialize();
Oculus.Platform.Entitlements.IsUserEntitledToApplication().OnComplete(callbackMethod);
}
void callbackMethod (Message msg) {
if (!msg.IsError) {
// Entitlement check passed
} else {
// Entitlement check failed
UnityEngine.Application.Quit();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment