예제 #1
0
    void OnTriggerStay2D(Collider2D other)     //Mientras estén en contacto...
    {
        PlayerHealth playerController = other.GetComponent <PlayerHealth>();
        EnemyHealth  enemyController  = other.GetComponent <EnemyHealth>();

        if (other.gameObject.tag == "Enemy")
        {
            enemyController.ApplyDamage("acid", acidToEnemy);
        }
        if (other.gameObject.tag == "Player")
        {
            playerController.ApplyDamage("acid", acidToPlayer);
        }
    }