Player Account Authentication
using System.Threading.Tasks;
using Coherence.Cloud;
using Coherence.Toolkit;
using UnityEngine;
public class LoginAsGuestExample : MonoBehaviour
{
public CoherenceBridge bridge;
private CloudService cloudService;
async void Start()
{
cloudService = bridge.CloudService;
await Login();
// At this point, we are ready to fully utilize the Cloud Service
}
private async Task Login()
{
var authService = cloudService.GameServices.AuthService;
var result = await authService.LoginAsGuest();
if (result.LoggedIn)
{
Debug.Log($"Logged in as: {result.Username}", this);
}
else
{
Debug.LogError(result, this);
}
}
}Was this helpful?

