diff --git a/Assets/Scripts/LeaderboardController.cs b/Assets/Scripts/LeaderboardController.cs index 5bfd2863..44a6cda9 100644 --- a/Assets/Scripts/LeaderboardController.cs +++ b/Assets/Scripts/LeaderboardController.cs @@ -19,6 +19,10 @@ public class LeaderboardController : MonoBehaviour public UnityEvent> OnDailyInit; public UnityEvent> OnGlobalInit; + private bool _resetDaily = false; + private bool _resetGlobal = false; + + private void Awake() { //transform.parent = null; @@ -34,12 +38,24 @@ public class LeaderboardController : MonoBehaviour } } - private void Start() + private IEnumerator Start() { - //yield return new WaitForSeconds(1); + yield return new WaitForSeconds(10); + if(_resetDaily) + PlayerPrefs.SetString(DAILY_ID, string.Empty); + if(_resetGlobal) + PlayerPrefs.SetString(GLOBAL_ID, string.Empty); InitLeaderboards(); } + private void Update() + { + if(Input.GetKeydown(KeyCode.J)) + _resetDaily = true; + if(Input.GetKeydown(KeyCode.K)) + _resetGlobal = true; + } + public void InitLeaderboards() { InitDailyLeaderboard();