Created
October 27, 2017 07:15
-
-
Save kelvinharron/1bd765cdd27600be16c95be5d97135be to your computer and use it in GitHub Desktop.
This file contains 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 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