コード例 #1
0
    void OnTriggerEnter(Collider other)
    {
        if (other.CompareTag("Boundary") || other.CompareTag("Enemy"))
        {
            return;
        }

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

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

        if (other.CompareTag("Player"))
        {
            _battleController.GameOver();
        }

        _battleController.AddScore(scoreValue);

        Destroy(other.gameObject);
        Destroy(this.gameObject);
    }