using UnityEngine.EventSystems;
print(EventSystem.current.IsPointerOverGameObject());
마우스 포인터가 UGUI 오브젝트 위에 올라가있을때 true를 반환하고 아니면 false를 반환
if (Input.GetMouseButtonDown(0) && !EventSystem.current.IsPointerOverGameObject())
마우스 포인터가 UGUI 위에 올라가 있지 않을 때 작동
'Unity > 수업 내용' 카테고리의 다른 글
| [Unity 2020.3] 10-21 MiniRPG 경험치 UI, 이펙트 (0) | 2021.10.21 |
|---|---|
| [Unity 2020.3] 10-20 MiniRPG 공격, 피격 이펙트 ,체력바, 플레이어 사망 (0) | 2021.10.20 |
| [Unity 2020.3] 10-20 MiniRPG 적 피격, 적 따라오기 (0) | 2021.10.20 |
| [Unity 2020.3] 10-19 MiniRPG 플레이어 공격, 적 피격 (0) | 2021.10.19 |
| [Unity 2020.3] Animation Clip의 재생시간 (0) | 2021.10.19 |