ugui 레이캐스트 ui에서는 막기.

|


if(Input.GetMouseButtonDown(0))

{

bool isPointerOVerGame = UnityEngine.EventSystems.EventSystem.current.IsPointerOverGameObject();

Debug.Log(isPointerOVerGame);

}


UnityEngine.EventSystems.EventSystem.current.IsPointerOverGameObject();


현재 마우스 위치가 ui 상에 있으면 true 반환

없으면 false 반환.



레이를 막아버리는 근본적인 방법을 사용해야지 좋지 않을까 싶음.

boxcollider을 붙인다던가..


Trackback 0 And Comment 0
prev | 1 | ··· | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | ··· | 104 | next