Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

- Declaration

public static void AwaitAuthentication(Action<CavrnusAuthentication> onAuth)

- Description

Throws an even when user authentication is complete.

This will trigger alongside the onSuccess from AuthenticateWithPassword (LINK) or AuthenticateAsGuest (LINK). It doesn’t know or care which method is used.

onAuth provides a CavrnusAuthentication (LINK) which you can then store/load on your local machine to use on a future run without requiring the user to re-login. [TUTORIAL FOR DOING THAT]

- Sample

using CavrnusSdk.API;
using UnityEngine;

public class AuthenticateAsGuest : MonoBehaviour
{
    public GameObject SpacesMenuPrefab;

    private void Start()
    {
        CavrnusFunctionLibrary.AwaitAuthentication(auth => OnAuth(auth));
    }

    private void OnAuth(CavrnusAuthentication auth)
    {
        //Instantiate the Spaces Menu now that we are logged in
        GameObject.Instantiate(SpacesMenuPrefab);
    }
}
  • No labels