Beispiel #1
0
    // Start is called before the first frame update
    void Start()
    {
        UpdateConsole("Init Oculus Platform SDK...");
        Core.AsyncInitialize().OnComplete(message => {
            if (message.IsError)
            {
                // Init failed, nothing will work
                UpdateConsole(message.GetError().Message);
            }
            else
            {
                /**
                 * Get the deeplink message when the app starts up
                 */
                UpdateConsole("Init complete!\n" + GetAppLaunchDetails());

                /**
                 * Get and cache the Logged in User ID for future queries
                 */
                Users.GetLoggedInUser().OnComplete(OnLoggedInUser);

                /**
                 * Get the list of destinations defined for this app from the developer portal
                 */
                RichPresence.GetDestinations().OnComplete(OnGetDestinations);

                /**
                 * Listen for future deeplink message changes that might come in
                 */
                ApplicationLifecycle.SetLaunchIntentChangedNotificationCallback(OnLaunchIntentChangeNotif);
            }
        });
    }