Ejemplo n.º 1
0
 void OnTriggerEnter(Collider other)
 {
     if (other.CompareTag("Coin"))
     {
         Coin coin = other.GetComponent <Coin>();
         GameState.countCoins += coin.currentValue;
         other.GetComponent <Coin>().DestroyCoin();
         InGameGUI.Instance.UpdateCoins();
     }
     if (other.CompareTag("ShieldCoin"))
     {
         other.GetComponent <ShieldPowerUp>().DestroyPowerUp();
         powerUp.Activate("Shield");
     }
     if (other.CompareTag("MagnetCoin"))
     {
         other.GetComponent <MagnetPowerUp>().DestroyPowerUp();
         powerUp.Activate("Magnet");
     }
     if (other.CompareTag("DoubleCoinPowerUp"))
     {
         other.GetComponent <DoubleCoinPowerUp>().DestroyPowerUp();
         powerUp.Activate("DoubleCoins");
     }
     if (other.CompareTag("FastRunPowerUp"))
     {
         other.GetComponent <FastRunPowerUp>().DestroyPowerUp();
         powerUp.Activate("FastRun");
     }
 }
Ejemplo n.º 2
0
 //forward call to the PowerUpManager
 //activate active powerup selection, if in sight
 public void ActivatePowerUp()
 {
     if (IsPowerUpSelected() && powerUpScript.GetSelection().position != SV.outOfView)
     {
         powerUpScript.Activate();
     }
 }
Ejemplo n.º 3
0
    public void StartWave(WaveManager manager)
    {
        if (end)
        {
            TransitionEffect.instance.transitionOut((Application.loadedLevel + 1) % Application.levelCount);
        }

        MusicManager.instance.playMusic(music);

        pum?.Activate();
        endWave += manager.StartNextWave;
        Sequence s = DOTween.Sequence();

        s.AppendInterval(leadtime);
        s.Append(GlobalEffects.instance.MoveCamOut(cameraZPosition, 1f));
        s.AppendCallback(() => {
            PlayCutscene();
        });
        s.AppendInterval(audioTime);
        s.AppendInterval(endTime);
        s.AppendCallback(() => {
            pum?.Deactivate();
            endWave.Invoke();
            endWave = null;
            CancelInvoke();
        });
    }
Ejemplo n.º 4
0
 private void Activate()
 {
     isMoving = false;
     powTimer.Restart(duration);
     powManager.Activate(this);
 }