Exemplo n.º 1
0
    private void OnTriggerExit2D(Collider2D collision)
    {
        IInfectable infectableObject = collision.GetComponent <IInfectable>();

        if (infectableObject != null)
        {
            allInfectablesInRange.Remove(infectableObject);
        }
    }
Exemplo n.º 2
0
    private void OnTriggerEnter(Collider other)
    {
        GameObject collisioned = other.gameObject;

        if (collisioned.GetComponent <IInfectable>() != null)
        {
            inRange     = true;
            iInfectable = collisioned.GetComponent <IInfectable>();
        }
    }