본문 바로가기

:::::: STUDY ::::::/Unity

Preventing uGUI mouse click from passing through GUI controls

Preventing uGUI mouse click from passing through GUI controls



- 버튼을 클릭 했을때 그 밑에 object collider가 있으면 둘 다 클릭이 된다.

그 이유는 이벤트가 object 먼저하고 GUI로 넘어오기 때문.
http://docs.unity3d.com/kr/current/Manual/ExecutionOrder.html

FixedUpdate->OnTriggerXXXX-> OnColliderXXXX-> OnMouseXXXX->Update->GUI event
간단하게 설명하자면
Physics -> input event -> game logic -> GUI 순으로 실행이 됨.

이걸 해결 하기 위해서는 

Preventing uGUI mouse click from passing through GUI controls

http://forum.unity3d.com/threads/preventing-ugui-mouse-click-from-passing-through-gui-controls.272114/

링크 참조~


간단하게 설명하자면

eventSystem.IsPointerOverGameObject()

사용하면 GUI부터 체크함.

':::::: STUDY :::::: > Unity' 카테고리의 다른 글

GPGS data storage limit  (0) 2017.02.01
Unity에서 Android Log 찍는법  (0) 2017.01.11
[Unity] there are 2 audio listeners in the scene  (0) 2016.04.28
[Unity] Unity ads 붙히기  (0) 2016.03.03
[Unity] Admob 광고 붙히기  (0) 2016.03.03