// Start is called before the first frame update void Start() { numberOfBall = ConfigurationUtils.NumberOfBallsPerGame; score = 0; textScore.text = "Score: " + score.ToString(); textBallsLeft.text = "Balls Left: " + numberOfBall.ToString(); EventManager.AddListenerPoints(AddPoints); EventManager.AddListenerBallsLeft(CountBallsLeft); lastBallLostEvent = new LastBallLostEvent(); EventManager.AddInvokerHUD(this); }
/// <summary> /// Use this for initialization /// </summary> void Start() { // initialize score text scoreText = GameObject.FindGameObjectWithTag("ScoreText").GetComponent <Text>(); scoreText.text = ScorePrefix + score; // initialize balls left value and text ballsLeft = ConfigurationUtils.BallsPerGame; ballsLeftText = GameObject.FindGameObjectWithTag("BallsLeftText").GetComponent <Text>(); ballsLeftText.text = BallsLeftPrefix + ballsLeft; EventManager.AddPointsAddedEffectListener(AddPoints); EventManager.AddBallsLeftEfectListener(ReduceBallsLeft); lastBallLostEvent = new LastBallLostEvent(); EventManager.AddLastBallLostEventInvoker(this); }
private void Start() { // initialize score text _scoreText = GameObject.FindGameObjectWithTag("ScoreText").GetComponent <Text>(); _scoreText.text = PrefixScoreText + _score; // initialize balls left value and text _ballsLeft = ConfigurationUtils.NumberBalls; _ballsLefText = GameObject.FindGameObjectWithTag("BallsLeftText").GetComponent <Text>(); _ballsLefText.text = PrefixBallLeftText + _ballsLeft; EventManager.AddPointsListener(AddScorePoints); EventManager.BallsLeftListeners(DecreaseBalls); EventManager.LastBlockListener(GameOver); _lastBall = new LastBallLostEvent(); EventManager.LastBallInvoker(this); }