Beispiel #1
0
 public void AddToScore(int toAdd)
 {
     currentScore += toAdd;
     uiGameplay.UpdateScore(currentScore, scoreNeededToWin);
     player.ResetRotation();
     if (currentScore >= scoreNeededToWin)
     {
         GameManager.Get().UpdateLevelsWon(lvlNumber);
         uiGameplay.OnLevelFinished(true);
     }
 }
Beispiel #2
0
 private void Start()
 {
     uiGameplay = FindObjectOfType <UIGameplay>();
     uiGameplay.UpdateScore(currentScore, scoreNeededToWin);
     uiGameplay.UpdateBallsLeft(startingBalls);
     lvlNumber = GameManager.Get().GetCurrentLvl();
     Cup[] cups = FindObjectsOfType <Cup>();
     for (int i = 0; i < cups.Length; i++)
     {
         cups[i].AddToScore = AddToScore;
     }
 }