Skip to content

Instantly share code, notes, and snippets.

@nhaskins
Created March 15, 2017 20:21
Show Gist options
  • Save nhaskins/e68702076a78b6146b2fc6511e945904 to your computer and use it in GitHub Desktop.
Save nhaskins/e68702076a78b6146b2fc6511e945904 to your computer and use it in GitHub Desktop.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Oculus.Platform;
//note: Must have Oculus Platform SDK for Unity installed!
public class OculusEntitlementCheck : MonoBehaviour {
// Use this for initialization
void Start () {
Core.Initialize("123456789");
Entitlements.IsUserEntitledToApplication().OnComplete(
(Message msg) =>
{
if (msg.IsError)
{
print("fired oculus platform, is not entitled");
// User is NOT entitled.
UnityEngine.Application.Quit();
//showMessageThatTheUserDoesntOwnThis();
} else
{
print("Oculus platform enetitlement check passed");
// User IS entitled
//proceedAsNormal();
}
}
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment