Exemple #1
0
        /*void Update ()
         * {
         *
         * }*/

        void Death()
        {
            enemyAudio.Play();
            Instantiate(playerExplosion, transform.position, transform.rotation);

            // The enemy is dead.
            //isDead = true;

            gameController.AddScore(scoreValue);
            //Destroy (other.gameObject);
            Destroy(gameObject);
        }
Exemple #2
0
        void Death()
        {
            // The enemy is dead.
            isDead = true;

            // Turn the collider into a trigger so shots can pass through it.
            capsuleCollider.isTrigger = true;

            // Change the audio clip of the audio source to the death clip and play it (this will stop the hurt clip playing).
            //enemyAudio.clip = deathClip;
            //enemyAudio.Play ();

            Instantiate(playerExplosion, other.transform.position, other.transform.rotation);

            gameController.AddScore(scoreValue);
            Destroy(other.gameObject);
            Destroy(gameObject);
        }
Exemple #3
0
        void OnTriggerEnter(Collider other)
        {
            if (other.tag == "Boundary" || other.tag == "Enemy")
            {
                return;
            }

            if (explosion != null)
            {
                Instantiate(explosion, transform.position, transform.rotation);
            }

            if (other.tag == "Player")
            {
                Instantiate(playerExplosion, other.transform.position, other.transform.rotation);
                gameController.GameOver();
            }

            gameController.AddScore(scoreValue);
            Destroy(other.gameObject);
            Destroy(gameObject);
        }