유니티 C#
UI버튼 클릭시 Input.GetMouseButton사용 중지하는법
죽은쥐
2020. 11. 12. 15:23
Unity: How to stop using "Input.GetMouseButton(0)" when pressing on UI Button?
The player is a magican who can attack enemys with fireballs when pressing the left mouse button. The code i use is pretty simple (inside the Update function): if (Input.GetMouseButton(0) &&...
stackoverflow.com
EventSystem.current.IsPointerOverGameObject() 함수를 사용하여 체크 가능
if (Input.GetMouseButton(0) && canShoot && !EventSystem.current.IsPointerOverGameObject())