// Update is called once per frame

    void OnTriggerEnter2D(Collider2D other)
    {
        if (other.gameObject.name == "Player")
        {
            bonusSound.Play();
            if (SpeedUp)
            {
                countSpeedUps = speedBonus.SpeedUpCounter(1);
            }
            if (countSpeedUps > 4)
            {
                thePowerManger.ActivatePowerup(dublePoints, ManyCoins, SpeedUp, PowerUpLength);
            }
            else
            {
                thePowerManger.ActivatePowerup(dublePoints, ManyCoins, false, PowerUpLength);
            }
            gameObject.SetActive(false);
        }
    }
예제 #2
0
 public void ButtonSpeedClicked()
 {
     thePowerManger.ActivatePowerup(false, false, true, 0);
 }