URP ์ฌ์ฉ ์ค
UI์ฉ ์๋ธ์นด๋ฉ๋ผ๋ฅผ ์ถ๊ฐํ๋๋ ์นด๋ฉ๋ผ ํ๊ฐ์ผ๋๋ ์ ์๋ํ๋ OnMouseOver ์ด๋ฒคํธ๊ฐ ๋จนํต
์๋ธ์นด๋ฉ๋ผ๋ฅผ ๋นํ์ฑํํ๋ฉด ์ด๋ฒคํธ ํธ์ถ์ด ์ ์์ ์ผ๋ก ๋จ
๊ตฌ๊ธ๋งํด์ ์ฐพ์ ๋ฐฉ๋ฒ๋ค
ํผ์ง์ค ๋ ์ด์บ์คํฐ๋ฅผ ์๋ธ์นด๋ฉ๋ผ์๋ ๋ฃ๊ธฐ = ์๋จ
์๋ธ์นด๋ฉ๋ผ์๋ ๋ฉ์ธ์นด๋ฉ๋ผ ํ๊ทธ๋ฅผ ๋ฌ์์ฃผ๊ธฐ = ์๋จ
์๋ธ์นด๋ฉ๋ผ๋ฅผ ๋นํ์ฑํํ๊ณ ๋ฉ์ธ์นด๋ฉ๋ผ์์ ์๋ธ์นด๋ฉ๋ผ์ Render ํจ์๋ฅผ ๊ฐ์ ๋ก ํธ์ถํ๊ธฐ = ์๋จ
๊ทธ์ธ ๋ ์ด์บ์คํธ๋ฅผ ์ฌ์ฉํ๋ ์ฐํ๋ฒ ์ธ ๊ธฐํ
ํน์ดํ ๊ฒ์ OnMouse~ ์ด๋ฒคํธ๋ง ์๋๊ณ OnPointer~ ์ด๋ฒคํธ๋ ์ ์์ ์ผ๋ก ํธ์ถ๋จ
OnMouse~๋ ์ด๋ฒคํธ์์คํ ์ ํตํด ํธ์ถํ๋๊ฒ ์๋๊ธฐ ๋๋ฌธ์ผ๋ก ์ถ์
ํด๊ฒฐ๋ฒ์ ๊ฒฐ๊ตญ ๋ชป์ฐพ์๊ณ ์ญ์ ์ฐํ๋ฒ์ ๋ง๋ค์ ๋ฐ์ ์์์
OnPointerEnter์์ ์ด ๊ฐ์ฒด๋ฅผ ์ ํ์ํ๋ก ๋๋ฆฐ๋ค
๊ฐ์ฒด์ Update(or LateUpdate)์์ ์ด ๊ฐ์ฒด๊ฐ ์ ํ์ํ์ด๋ฉด OnMouseOver๋ฅผ ์ง์ ํธ์ถํ๋ค
OnPointerExit์์ ์ด ๊ฐ์ฒด์ ์ ํ์ํ๋ฅผ ํด์ ํ๋ค
OnDisabled์์ ์ด ๊ฐ์ฒด์ ์ ํ์ํ๋ฅผ ํด์ ํ๋ค
๋ง์ฝ ์ด๋ฒคํธ ์์คํ ์ ์ปค์คํฐ๋ง์ด์ง ๊ฐ๋ฅ ํ๋ค๋ฉด PointerOver ์ด๋ฒคํธ๋ฅผ ๋ง๋ค๋ฉด ๊ทธ๋ง์ธ๋ฐ
์ ๋ํฐ ์ด๋ฒคํธ ์์คํ
๋ด๋ถ ์ฝ๋๋ ๋น๊ณต๊ฐ๋ผ์ ๊ฑด๋๋ฆด ์ ์์
์๋ธ์นด๋ฉ๋ผ๊ฐ UI์ฉ์ธ๊ฑฐ์ผ? ๋ฉ์ธ์ UI์ฉ์ผ๋ก ์จ๋ ๊ฐ์?
๋์ ์ญํ ์ ๋ฐ๊ฟ๋ ํด๊ฒฐ ์๋จ, ์ ์ผํ๊ฒ ํด๊ฒฐ์ด ๋๋ ์ํฉ์ ์นด๋ฉ๋ผ๋ฅผ ํ๊ฐ๋ง ํ์ฑํํ์ ๊ฒฝ์ฐ
onMouse ๊ฑ ๊ฐ๋ฐ์์๋ผ๋ค๋ ๊น๋จน์ ๋ฒ๋ ค์ง ํจ์๋ค ์ฐ์ง๋ง๋ผ
https://issuetracker.unity3d.com/issues/urp-onmouse-methods-are-not-called-when-using-camera-stacking-with-different-culling-masks
์ธ๋ถ์ด๋ค์ ๊ฐ์ vote ์ข ํด์ฃผ๋ผ
์ง์ง ์ง์ ธ์ฐ๋ค