public void UploadScore(Score score) { try { _scoreTable.Insert(score, UploadScoreCallback); } catch (Exception e) { Debug.Log(e.Message); } }
/// <summary> /// Ends the gameplay session and adds a new score item to the local database /// </summary> /// <param name="score"></param> public void EndSession(int score) { if (score > 0) { Score newScore = new Score() { Value = score, Leaderboard = gameID, Player = playerData.NickName, CreatedDate = DateTime.Now }; //leaderBoardData.scores.Add(newScore); } ProcessScores(); if (OnGameSessionEnded != null) OnGameSessionEnded(); }
public IEnumerator ProcessScoresCoroutine() { Score highestRankedItem = null; //foreach (var hs in leaderBoardData.scores) //{ // if (currentHighScore == null || hs.Value > currentHighScore.Value) // highestRankedItem = hs; // yield return null; //} if (currentHighScore == null || highestRankedItem != currentHighScore) { //newHighScore = true; currentHighScore = highestRankedItem; } yield return 0; }