Unity integration
To interact with the PLAY API, you will need to be authenticated. This will allow you to store and retrieve additional user data in the PLAY ecosystem.
If the Auto Guest Login option in RGNUnityInitilizer.cs is checked, logging out from email will automatically sign you back in as guest.
using RGN.Modules.SignIn;
public class EmailLoginLogout : MonoBehaviour
{
public void EmailSignIn()
{
// This call will open a web form
// Handle the result in RGNCore.I.AuthenticationChanged event callback
EmailSignInModule.I.TryToSignIn();
}
public void EmailSignOut()
{
EmailSignInModule.I.SignOut();
}
}using RGN;
using RGN.Modules.SignIn;
using UnityEngine;
public class AuthenticationChangedController : MonoBehaviour
{
private void OnEnable()
{
RGNCore.I.AuthenticationChanged += OnAuthenticationChangedAsync;
}
private void OnDisable()
{
RGNCore.I.AuthenticationChanged -= OnAuthenticationChangedAsync;
}
private async void OnAuthenticationChangedAsync(AuthState authState)
{
switch (authState.LoginState)
{
case EnumLoginState.Success:
Debug.Log("User is logged in");
// You can start retrieving some data here
break;
case EnumLoginState.NotLoggedIn:
Debug.Log("User is not logged in");
break;
case EnumLoginState.Error:
Debug.LogError("On Auth error: " + authState.LoginState +
", error: " + authState.LoginResult);
break;
default:
Debug.LogError("Unhandled Login State: " + authState.LoginState);
break;
}
}
}Unreal integration
Introduction
To interact with the PLAY API, you will need to be authenticated. This will allow you to store and retrieve additional user data in the PLAY ecosystem.
By default, the project is configured to automatically log into a guest account. This feature is enabled in the plugin settings.
If you require more control over this process, you can disable the checkbox and manually manage guest account logins.
Integration Guide
