Exemple #1
0
    private void OnTriggerExit2D(Collider2D collision)
    {
        IInfectable infectableObject = collision.GetComponent <IInfectable>();

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

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