23 lines
554 B
C#
23 lines
554 B
C#
using System.Threading.Tasks;
|
|
using Unity.Services.Authentication;
|
|
using Unity.Services.Core;
|
|
using UnityEngine;
|
|
|
|
public class LeaderBoardInitializer : MonoBehaviour
|
|
{
|
|
private async void Awake()
|
|
{
|
|
await Init();
|
|
}
|
|
|
|
private async Task Init()
|
|
{
|
|
await UnityServices.InitializeAsync();
|
|
if(!AuthenticationService.Instance.IsSignedIn)
|
|
{
|
|
await AuthenticationService.Instance.SignInAnonymouslyAsync();
|
|
}
|
|
Debug.Log("Signed in as :" + AuthenticationService.Instance.PlayerId);
|
|
}
|
|
}
|