Ejemplo n.º 1
0
        public void SubmitScore(string playerName)
        {
            FirebaseUser currentUser = FirebaseAuthManager.Instance.User;

            _firestoreLeaderData = new FirestoreLeaderData(playerName,
                                                           SessionViewModel.Instance.score,
                                                           SessionViewModel.Instance.won, currentUser.UserId);
            Debug.Log("Should write to db");
            FirebaseFirestore firestore = FirebaseFirestore.DefaultInstance;

            firestore.Document($"leaderboards/{CrossSceneLevelContainer.Instance.level.id}/leaders/{currentUser.UserId}").SetAsync(_firestoreLeaderData);
            GoToScoreboard();
        }
Ejemplo n.º 2
0
 private static int ScoreSorter(FirestoreLeaderData firestoreLeader)
 {
     return(firestoreLeader.Score);
 }