how to use "blocking object" in unity 5 ?

hi guys, I tried to add a button in my scene. in the canvas of the button, I set “blocking object” to “all” in the graphic raycaster. In the scene,there is a gameobject with a script,simply code:

if input.getmousebuttondown(0)
{
doSomething();
}

but when I click on the button

I found the click is not blocking,the “dosSomething” is still called

is that a new problem for unity5?.

or, is there another way,when i click on the objects on UI layer, the object on other layer will not triger any event?

UI doesn’t block physics raycasts, so GetMouseButtonDown will pass through.

you can check if the click is over a ui element though:

http://docs.unity3d.com/ScriptReference/EventSystems.EventSystem.IsPointerOverGameObject.html

thanks to all of above
then, should I use event trigger interface for all script which will be attach to a gameObject that under UI?
and,what’s the correct use of “blocking object”?