Ejemplo n.º 1
0
    public virtual void OnTriggerStay2D(Collider2D collision)
    {
        if (collision.GetComponent <Enemy>())
        {
            if (!collision.GetComponent <Enemy>().enemyActivated)
            {
                return;
            }
        }

        if (collision.GetComponent <Portal>())
        {
            if (!collision.GetComponent <Portal>().portalActivated)
            {
                return;
            }
        }

        if (collision.GetComponent <Character>())
        {
            ammoType.Damage(collision.GetComponent <Character>(), this.gameObject);
        }
        else
        {
            Destroy(gameObject);
        }
    }