void OnTriggerExit2D(Collider2D other) { if (other.gameObject.CompareTag(Tags.OBJECT)) { inCollision = null; } else if (other.gameObject.CompareTag(Tags.AREA_RELEASE)) { releaseArea = null; } }
void OnTriggerEnter2D(Collider2D other) { if (other.gameObject.CompareTag(Tags.OBJECT)) { inCollision = other.gameObject.GetComponent <InteractableObject>(); } if (other.gameObject.CompareTag(Tags.AREA_RELEASE)) { releaseArea = other.gameObject.GetComponent <ReleaseArea>(); } if (other.gameObject.CompareTag(Tags.ROOM)) { whichRoom = other.gameObject; } }