Exemplo n.º 1
0
        private void PropelPlayer()
        {
            _fireworkEffect.Play();

            _soundManager.PlaySound(2);

            _projectileRigidbody.AddForce(_fireworkForce, ForceMode2D.Impulse);

            _fireworkCurrentCount--;

            _gameManager.UpdateFireworks(_fireworkCurrentCount);
        }
Exemplo n.º 2
0
        private void OnTriggerEnter2D(Collider2D collider)
        {
            if (collider.gameObject.CompareTag("Player"))
            {
                Sled_2 player = collider.gameObject.GetComponent <Sled_2>();

                if (player.FireworkCurrentCount < player.FireworkMaxCount)
                {
                    _particle.Emit(20);

                    _soundManager.PlaySound(3);

                    player.FireworkCurrentCount++;

                    _gameManager.UpdateFireworks(player.FireworkCurrentCount);

                    Destroy(this.gameObject);
                }
            }
        }