Beispiel #1
0
    private void OnTriggerEnter(Collider other)
    {
        //爆風に巻き込まれたら爆発
        if (other.tag == "Bomb")
        {
            Explosion();
        }

        //キューブを破壊
        if (other.tag == "Cube")
        {
            block_map.BreakBlock(other.GetComponent <BlockNumber>());
            Destroy(other.gameObject);
        }

        //爆弾の威力をプレイヤーに伝える
        for (int i = 1; i <= 4; ++i)
        {
            if (other.CompareTag("Player" + i))
            {
                other.GetComponent <Player>().bombimpact = Bombimpact;
            }
        }

        //フィールド外に落ちた場合
        if (other.tag == "DustBox")
        {
            Destroy(gameObject);
        }
    }