public override void Initialize() { CommonData.mainCamera.mode = CameraController.CameraMode.Gameplay; TimeUploaded = false; Firebase.Analytics.FirebaseAnalytics.LogEvent(StringConstants.AnalyticsEventTimeUploadStarted, StringConstants.AnalyticsParamMapId, CommonData.gameWorld.worldMap.mapId); manager.PushState(new WaitForTask( TimeDataUtil.UploadReplay(Time, CommonData.gameWorld.worldMap, CommonData.gameWorld.PreviousReplayData) .ContinueWith(task => LeaderboardController.AddScore(task.Result)), StringConstants.UploadTimeTitle, true)); }
private void OnTriggerEnter2D(Collider2D collision) { if (collision.gameObject.tag == "Enemy") { jump = true; collision.gameObject.SendMessage("Die", gameObject); } else if (collision.gameObject.tag == "Stairs") { canClimb = true; } else if (collision.gameObject.tag == "EndLevelTrigger" && !leaderboardUI.gameObject.activeSelf) { leaderboardUI.AddScore("Play", score); leaderboardUI.gameObject.SetActive(true); } else { animator.SetBool("IsJumping", false); } }
/// <summary> /// Called by AddScore() and by AddRandomScores(). Invokes AddScore from the /// LeaderboardController, but does not update the top scores display on its own. /// </summary> /// <param name="userId">User ID for whom to add a score.</param> /// <param name="score">Score to add.</param> public void AddScore(string userId, string username, int score) { leaderboard.AddScore(userId, username, score); }
public void LeaderboardNameSet() { leaderboardUI.AddScore(SceneManager.GetActiveScene().name, leaderboardName.text, score); inputNameUI.SetActive(false); leaderboardUI.gameObject.SetActive(true); }
public void SetLeaderboardName() { leaderboardUI.AddScore(leaderboardName.text, score); inputNameUI.SetActive(false); leaderboardUI.gameObject.SetActive(true); }