コード例 #1
0
    void OnTriggerEnter2D(Collider2D other)
    {
        if (other.gameObject.name == "Bullet(Clone)")
        {
            _Enemyhealth -= 25;
            Destroy(other.gameObject);
            _checkCoins.AddCoinsArch();
        }

        else if (other.gameObject.name == "CannonBullet(Clone)")
        {
            _Enemyhealth -= 50;
            Destroy(other.gameObject);
            _checkCoins.AddCoinsCan();
        }

        else if (other.gameObject.name == "WizardBullet(Clone)")
        {
            _Enemyhealth -= 100;
            Destroy(other.gameObject);
            _checkCoins.AddCoinsWiz();
        }
    }