Wednesday, August 1, 2018

If TestEntitlementCheck failed while running OculusVRCValidator

Sample Entitlement check file

Make sure you install Oculus Utilities & Oculus Platform packages
https://developer.oculus.com/downloads/package/oculus-utilities-for-unity-5/
https://developer.oculus.com/downloads/package/oculus-platform-sdk/


using UnityEngine;
using System.Collections;
using Oculus.Platform;
using UnityEngine.Events;
using UnityEngine.SceneManagement;

public class EntitlementManager : MonoBehaviour
{
 
    public string appId;
    public static bool entSucceded = false;

    void Start()
    {
        // Core.Initialize(appId);
        if (!entSucceded)
        {
            Core.AsyncInitialize(appId);
            Entitlements.IsUserEntitledToApplication().OnComplete(EntitlementChecked);
        }
    }

    /*
    void Update()
    {
        Request.RunCallbacks();
    } */

    void EntitlementChecked(Message msg)
    {

        // Ok
        if (!msg.IsError)
        {
            // Do what you want, load main menu
            // SceneManager.LoadScene("MainMenu", LoadSceneMode.Single);
            Debug.Log("Ent success!");
        }
        // Not Ok
        else
        {
            //UnityEngine.Application.Quit();
            SceneManager.LoadScene("EntFailed", LoadSceneMode.Single);
            Debug.Log(msg.GetError());
            entSucceded = true;
        }
    }
}

No comments:

Turn on Windows 11 Fast Boot

If windows starting is slow, to enable windows 11 fast startup/boot,  Press Windows + R, type powercfg.cpl, and hit Enter.  This will direct...