[한수빈] 홈 화면에서 프로젝트 클릭 후에 hover상태 유지되던 문제 해결
This commit is contained in:
2
Assets/Scripts/Camera/CameraRoute.cs.meta
Normal file
2
Assets/Scripts/Camera/CameraRoute.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6de7838db2221394597524e5a7722f9f
|
||||
@@ -9,7 +9,7 @@ using DG.Tweening;
|
||||
|
||||
namespace OCTOPUS_TWIN
|
||||
{
|
||||
public class ProjectItemView : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler
|
||||
public class ProjectItemView : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler, IPointerClickHandler
|
||||
{
|
||||
[SerializeField] private TextMeshProUGUI textTitle;
|
||||
[SerializeField] private TextMeshProUGUI textDesc;
|
||||
@@ -36,12 +36,22 @@ namespace OCTOPUS_TWIN
|
||||
}
|
||||
|
||||
public void OnPointerExit(PointerEventData eventData)
|
||||
{
|
||||
FadeOut();
|
||||
}
|
||||
|
||||
public void OnPointerClick(PointerEventData eventData)
|
||||
{
|
||||
FadeOut();
|
||||
|
||||
// 클릭 후 버튼에 남는 '선택된 상태' 잔상 제거
|
||||
EventSystem.current.SetSelectedGameObject(null);
|
||||
}
|
||||
|
||||
private void FadeOut()
|
||||
{
|
||||
if (hoverOverlayImage == null) return;
|
||||
|
||||
hoverOverlayImage.DOKill();
|
||||
|
||||
// 알파값을 0으로 변경
|
||||
hoverOverlayImage.DOFade(0f, fadeDuration);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user