private void OnTriggerExit2D(Collider2D collision) { EventHotSpot otherHotspot = collision.GetComponent <EventHotSpot>(); if (otherHotspot != null && otherHotspot == eventHotspot) { otherHotspot.aButton.SetActive(false); eventHotspot = null; } }
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); } }