void Awake() { if (newClient == null) { newClient = new NewClientEvent(); } if (taskComplete == null) { taskComplete = new TaskCompleteEvent(); } if (newIron == null) { newIron = new NewIronEvent(); } if (newClothes == null) { newClothes = new NewClothesEvent(); } if (timeExpired == null) { timeExpired = new TimeExpiredEvent(); } if (addScore == null) { addScore = new AddScoreEvent(); } }
private void Awake() { gameOverEvent = new GameOverEvent(); addScoreEvent = new AddScoreEvent(); powerPickupEvent = new PowerPickupEvent(); stickToPaddleEvent = new StickToPaddleEvent(); coinPickUpEvent = new CoinPickUpEvent(); explodeEvent = new ExplodeEvent(); ballHitEvent = new BallHitEvent(); brickDamageEvent = new BrickDamageEvent(); }
public void AddScore(int value) { Scores += value; if (Scores > PlayerPrefs.GetInt("Highscore")) { PlayerPrefs.SetInt("Highscore", Scores); PlayerPrefs.Save(); } AddScoreEvent?.Invoke(value); }
public void AddScore(int value) { AddScoreEvent?.Invoke(value); }
private void OnAddScore(AddScoreEvent e) { score += e.scoreToAdd; scoreText.text = "Score: " + score.ToString(); }