Exemple #1
0
    IEnumerator DeactivateRoutine()
    {
        OnPlaySFX?.Invoke(_explosionClip);
        _anim.SetTrigger("Explode");
        yield return(new WaitForSeconds(_destroyDelay));

        gameObject.SetActive(false);
    }
Exemple #2
0
    private void OnTriggerEnter2D(Collider2D other)
    {
        if (other.tag == "Player")
        {
            Player player = OnGetPlayerScript?.Invoke();
            if (player != null)
            {
                OnPlaySFX?.Invoke(_powerUpClip);
                switch (_powerUpType)
                {
                case PowerUpType.TripleShot:
                    player.TripleShotActivate();
                    break;

                case PowerUpType.SpeedBoost:
                    player.SpeedBoostActivate();
                    break;

                case PowerUpType.Shield:
                    player.ShieldActivate();
                    break;

                case PowerUpType.Ammo:
                    player.ChangeAmmo();
                    break;

                case PowerUpType.Health:
                    player.ChangeLives(_healAmount);
                    break;

                case PowerUpType.Missile:
                    player.ActivateHomingMissiles();
                    break;

                case PowerUpType.OmniShot:
                    player.OmniShotActivate();
                    break;

                case PowerUpType.Negative:
                    player.ChangeLives(-_healAmount);
                    player.NegativeEffectActivate();
                    break;

                default:
                    break;
                }
            }
            gameObject.SetActive(false);
        }
    }
Exemple #3
0
 public void PlayClip(AudioClip clip)
 {
     OnPlaySFX?.Invoke(clip);
 }
Exemple #4
0
 protected void PlayClip(AudioClip clip)
 {
     OnPlaySFX?.Invoke(clip);
 }