Ejemplo n.º 1
0
        public void SaveDailyChallenge(int score)
        {
            var entry = new ScoreEntry()
            {
                User  = UserManager.UserID,
                Score = score,
                Date  = DateTime.Now.ToString()
            };

            var jsonValue = JsonUtility.ToJson(entry);

            FireBaseDatabase.AddUniqueJSON(FireBaseSavePaths.DailyChallengeLocation(DateTime.Now), jsonValue);
        }
Ejemplo n.º 2
0
 public void GetDailyScoresAsync()
 {
     try
     {
         var t = new Task(() =>
         {
             var result = FireBaseReader.ReadSingleAsync <ScoreEntry>(FireBaseSavePaths.DailyChallengeLocation(DateTime.Now));
             DailyScoresLoaded?.Invoke(result.Result);
         });
         t.Start();
     }
     catch (Exception ex)
     {
         DebugLogger.Instance.WriteException(ex);
     }
 }