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(); }
private static int ScoreSorter(FirestoreLeaderData firestoreLeader) { return(firestoreLeader.Score); }