private void SetScoreCallback(string exception) { if (exception != null) { print("SetScore= " + exception); StartCoroutine(LeaderBoard.GetLeaderBoard(LeaderBoardCallback)); } }
// Use this for initialization void Start() { LeaderBoard.SetApiKey(ApiKey); _textMesh = GetComponent <TextMesh>(); if (DataContainer.score > 0 && DataContainer.nickName != string.Empty) { print(string.Format("Sending request to server with {0},{1}", DataContainer.nickName, DataContainer.score)); StartCoroutine(LeaderBoard.SetScore(DataContainer.nickName, DataContainer.score, SetScoreCallback)); } else { Debug.LogWarning("Data sending failed, no nickname of score provided!"); StartCoroutine(LeaderBoard.GetLeaderBoard(LeaderBoardCallback)); } }