- Declaration
public static void AwaitAuthentication(Action<CavrnusAuthentication> onAuth)
- Description
Throws an even event 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 usedis agnostic to the method used for authentication.
onAuth
provides a CavrnusAuthentication (LINK) object, which you can then store/load can be stored or loaded on your local machine to for use on during a future run without requiring . This eliminates the need for the user to re-login. [TUTORIAL FOR DOING THAT]
- Sample
Code Block |
---|
using CavrnusSdk.API; using UnityEngine; public class AwaitAuthentication : 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); } } |