Ejemplo n.º 1
0
 protected virtual void OnTriggerEnter2D(Collider2D collision)
 {
     if (HpableExtension.IsFromWrongTeam(this, collision, out Bullet bullet))
     {
         this.Hp.TakeHp(bullet.Dmg, "Bullet");
         bullet.Kill();
     }
 }
Ejemplo n.º 2
0
    protected void OnTriggerEnter2D(Collider2D collision)
    {
        if (HpableExtension.IsFromWrongTeam(this, collision, out Bullet bullet))
        {
            this.Hp.TakeHp(bullet.Dmg, "Bullet");
            bullet.Kill();
        }

        if (itemTrigger = collision.GetComponent <ItemOnTrigger>())
        {
            return;
        }
    }
Ejemplo n.º 3
0
    protected void OnTriggerEnter2D(Collider2D collision)
    {
        if (HpableExtension.IsFromWrongTeam(this, collision, out Bullet bullet))
        {
            this.Hp.TakeHp(bullet.Dmg, "Bullet");
            bullet.Kill();
        }

        if (collision.GetComponent <Resource>())
        {
            collidesWithResource = true;
        }
    }