Unity 4.6 GUIUtility.hotControl

Hello, I have an if statement that checks if I’m clicking a GUI element or not:

if (Input.GetMouseButtonDown (0) && GUIUtility.hotControl == 0)

But it doesn’t seem to work with the new GUI system in Unity version 4.6,
because the GUI seems to returns 0.

Could anyone tell me what is the new way of doing it?

Thank you.

using UnityEngine.EventSystems;


if (Input.GetMouseButtonDown(0) && EventSystemManager.currentSystem.IsPointerOverEventSystemObject())

Had the same exact doubt this morning and asked the forum for an answer :slight_smile: