Esempio n. 1
0
    void OnTriggerEnter(Collider other)
    {
        if (other.tag == "bound")
        {
            return;
        }

        Destroy(other.gameObject);
        Destroy(gameObject);
        Instantiate(explosion, transform.position, transform.rotation);

        if (other.tag == "Player")
        {
            Instantiate(explosionPlayer, other.transform.position, other.transform.rotation);
            gameController.GameOver();
        }
        gameController.AddScore(scoreValue);
    }
    void OnTriggerEnter(Collider other)
    {
        if (other.CompareTag("bound") || other.CompareTag("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);
    }