示例#1
0
        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));
        }
示例#2
0
 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);
     }
 }
示例#3
0
 /// <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);
 }
示例#4
0
 public void LeaderboardNameSet()
 {
     leaderboardUI.AddScore(SceneManager.GetActiveScene().name, leaderboardName.text, score);
     inputNameUI.SetActive(false);
     leaderboardUI.gameObject.SetActive(true);
 }
示例#5
0
 public void SetLeaderboardName()
 {
     leaderboardUI.AddScore(leaderboardName.text, score);
     inputNameUI.SetActive(false);
     leaderboardUI.gameObject.SetActive(true);
 }