leaderboard feature added

This commit is contained in:
Mausham
2025-12-17 22:16:41 +05:45
parent df4017f6be
commit f19bbb9d8c
25 changed files with 106 additions and 170 deletions

View File

@@ -0,0 +1,28 @@
using Unity.Services.Core;
using System.Threading.Tasks;
using Unity.Services.Authentication;
using UnityEngine;
namespace Darkmatter.Presentation
{
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();
}
PlayerPrefs.SetString("PlayerID", AuthenticationService.Instance.PlayerId);
PlayerPrefs.Save();
}
}
}