예제 #1
0
    private void OnTriggerExit2D(Collider2D collision)
    {
        EventHotSpot otherHotspot = collision.GetComponent <EventHotSpot>();

        if (otherHotspot != null && otherHotspot == eventHotspot)
        {
            otherHotspot.aButton.SetActive(false);
            eventHotspot = null;
        }
    }
예제 #2
0
    private void OnTriggerEnter2D(Collider2D other)
    {
        EventHotSpot otherHotspot = other.GetComponent <EventHotSpot>();

        // start interaction with event
        if (otherHotspot != null && otherHotspot.theEvent != null)
        {
            eventHotspot = otherHotspot;
            otherHotspot.aButton.SetActive(true);
        }
    }