Created
March 15, 2017 20:21
-
-
Save nhaskins/e68702076a78b6146b2fc6511e945904 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; | |
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