Example #1
0
 void Start()
 {
     HighScoreText.SetActive(false);
     scoreText.text = "0";
     Kills.SetActive(false);
     MyEventManager.Instance.DeactivatePooledObjects.Dispatch();
     LeanTween.value(0f, ScoreManager.Instance.GetScore(), .5f).setOnUpdate(OnUpdate).setOnComplete(OnComplete);
 }
Example #2
0
        private void AddToScore()
        {
            Kills.SetActive(false);
            Debug.Log(ScoreManager.Instance.GetKills() * ScoreManager.Instance.GetScorePerKill());
            int score = ScoreManager.Instance.GetScore() + (ScoreManager.Instance.GetKills() * ScoreManager.Instance.GetScorePerKill());

            LeanTween.value(ScoreManager.Instance.GetScore(), score, .5f).setOnUpdate(OnUpdate);
            CheckHighScore(score);
        }
Example #3
0
 private void OnComplete()
 {
     if (ScoreManager.Instance.GetKills() > 0)
     {
         Kills.SetActive(true);
         Kills.text = "+" + ScoreManager.Instance.GetKills() + " Kills";
         LeanTween.moveY(Kills.rectTransform, 300f, 1f).setOnComplete(AddToScore);
     }
     else
     {
         CheckHighScore(ScoreManager.Instance.GetScore());
     }
 }