Made UI compatible with new EventSystem.