예제 #1
0
    void OnTriggerEnter2D(Collider2D other)
    {
        if (other.GetComponent <IActivatesFloorButtons>() != null)
        {
            IActivatesFloorButtons activator = other.GetComponent <IActivatesFloorButtons>();

            if (activator.ActivatesFloorButtons)
            {
                activators.Add(activator);
            }
        }
    }
예제 #2
0
    void OnTriggerExit2D(Collider2D other)
    {
        if (other.GetComponent <IActivatesFloorButtons>() != null)
        {
            IActivatesFloorButtons activator = other.GetComponent <IActivatesFloorButtons>();

            if (activators.Contains(activator))
            {
                activators.Remove(activator);
            }
        }
    }