Beispiel #1
0
    void OnTriggerEnter(Collider other)
    {
        if (other.tag == "Boundary")
        {
            gameController.AddTotal(TotalValue);
            return;
        }
        if (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);
    }