Exemplo n.º 1
0
    public void OnTriggerStay2D(Collider2D collider)
    {
        if (damagePerSecond < Mathf.Epsilon)
        {
            return;
        }
        ICollidesWithProjectiles target = collider.GetComponent <ICollidesWithProjectiles>();

        if (target != null)
        {
            target.ReceiveProjectile(this);
        }
    }
Exemplo n.º 2
0
    public void OnTriggerEnter2D(Collider2D collider)
    {
        ICollidesWithProjectiles target = collider.GetComponent <ICollidesWithProjectiles>();

        if (target != null)
        {
            if (target.ReceiveProjectile(this))
            {
                if (destroyOnContact)
                {
                    Destroy(gameObject);
                }
            }
        }
    }