Hello this is the code that i’m using:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SocialPlatforms;
public class GameCenterManager : MonoBehaviour
{
public static GameCenterManager instance;
[HideInInspector]
public bool gameCenterLoginSuccess;
private void Awake()
{
DontDestroyOnLoad(this);
if (instance == null)
instance = this;
else
Destroy(gameObject);
// logs the user in to game center
#if UNITY_IOS
Social.localUser.Authenticate((bool success) => {
if (success)
gameCenterLoginSuccess = true;
});
#endif
}
private void Start()
{
ReportWinsScore(DataManager.instance.GetInt(DataManager.instance.winsData));
}
public void ReportWinsScore(int wins)
{
if (!gameCenterLoginSuccess)
return;
Social.ReportScore(wins, LeaderboardIDs.WINS_LEADERBOARD_ID, success => {
Debug.Log(success ? "Reported score successfully" : "Failed to report score");
});
}
public void ShowLeaderboard()
{
if (!gameCenterLoginSuccess)
return;
Social.ShowLeaderboardUI();
}
}
Everything works, except, the today leaderboards that aren’t permanent don’t reset after the day has passed. I report the wins, when a new win is added and at the start of the game just incase the user has played offline for a while. Does anybody know why?
EDIT: Another issue, is that it doesn’t indicate that it is in sandbox mode.