It says "Leaderboard service currently not available" when I click on it immediately for the first time after reloading the game. But if I reload the game, and wait for a little while and then click it, it works fine. I am guessing there is some async call when you get to the main menu that fetches the leaderboard, and the leaderboard code just checks if the leaderboard is present or not and doesn't check if we are currently fetching the leaderboard? Just a guess though, as I was not able to find the sourcecode on the page
That shouldn't be too hard actually. Can do it with coroutines, I am pretty sure:
IEnumerator RenderLeaderboardEnumerator() { // enable the loading spinner while (leaderboard_hasn't_loaded) { // update the loading spinner() * Time.deltaTime or something idk; yield return new WaitForEndOfFrame(); } // disable the loading spinner RenderLeaderboard() ;;; } ...
// in your OnEnable or wherever you are fetching: StartCoroutine(RenderLeaderboardEnumerator());
Something like that, I imagine. You will have to fill in a lot of the blanks though