コード例 #1
0
ファイル: InrtoScript.cs プロジェクト: robinhuud/ShipnoRedux
 void CheckComplete(Oculus.Platform.Message callback)
 {
     if (callback.IsError)
     {
         Application.Quit();
     }
     else
     {
         Debug.Log("Passed");
         readyToGo = true;
     }
 }
コード例 #2
0
    // handle the callback message
    private void CheckCallback(Oculus.Platform.Message msg)
    {
        if (!msg.IsError)
        {
            // Entitlement check passed
            if (debugMode)
            {
                Debug.LogWarning("Entitlement Check: Passed");
            }
        }
        else
        {
            // Entitlement check failed
            // NOTE: You may not allow the user to proceed in your app after a failed entitlement check.
            Debug.LogWarning("Entitlement Check: Failed!");
            Debug.Log("Entitlement Check: Core Initialized " + Oculus.Platform.Core.IsInitialized());

            // time since startup check
            if (Time.realtimeSinceStartup > 10)
            {
                Debug.LogWarning("Entitlement Check: Timeout. Must check within 10 seconds.");
            }

            // default to quiting the application on faild entitlement check
            if (quitOnFail)
            {
                UnityEngine.Application.Quit();

#if UNITY_EDITOR
                UnityEditor.EditorApplication.isPlaying = false;
#endif
            }
        }

        if (debugMode)
        {
            Debug.Log("Entitlement Check: " + Time.realtimeSinceStartup + " seconds");
        }

        FinishCheck();
    }