Ejemplo n.º 1
0
    void OnTriggerEnter2D(Collider2D other)
    {
        if (other.tag == "FireBullet")
        {
            bullet = FindObjectOfType <FireBulletController>();
            Takedamage(bullet.damage);
            if (health != 0)
            {
                anim.SetTrigger("Hit");
            }
        }

        if (other.tag == "Player" && !playerNear)
        {
            player.Takedamage(evidamage);
        }

        if (other.tag == "Player" && playerNear)
        {
            if (this.gameObject.tag == "Flamemon")
            {
                player.Takedamage(flameBunchDamage);
            }

            if (this.gameObject.tag == "Pinocchimon")
            {
                player.Takedamage(pinoBunchDamage);
            }
        }
        if (other.tag == "Flamemon" || other.tag == "Pinocchimon")
        {
            moveRight = !moveRight;
        }
    }