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; } }
public bool CheckOnOutOfBalls() { ballsUsed++; uiGameplay.UpdateBallsLeft(startingBalls - ballsUsed); if (ballsUsed < startingBalls) { return(false); } else { uiGameplay.OnLevelFinished(false); return(true); } }