Esempio n. 1
0
    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();
        }
    }
Esempio n. 2
0
 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();
 }
Esempio n. 3
0
        public void AddScore(int value)
        {
            Scores += value;

            if (Scores > PlayerPrefs.GetInt("Highscore"))
            {
                PlayerPrefs.SetInt("Highscore", Scores);
                PlayerPrefs.Save();
            }

            AddScoreEvent?.Invoke(value);
        }
Esempio n. 4
0
 public void AddScore(int value)
 {
     AddScoreEvent?.Invoke(value);
 }
Esempio n. 5
0
 private void OnAddScore(AddScoreEvent e)
 {
     score += e.scoreToAdd;
     scoreText.text = "Score: " + score.ToString();
 }