scrollRect3 [Unity] EventSystem설정 터치 감도 조절 private const float inchToCm = 2.54f; [SerializeField] private EventSystem eventSystem = null; [SerializeField] private float dragThresholdCM = 0.5f; //For drag Threshold private void SetDragThreshold() { if (eventSystem != null) { eventSystem.pixelDragThreshold = (int)(dragThresholdCM * Screen.dpi / inchToCm); } } void Awake() { SetDragThreshold(); } Unity로 안드로이드 앱을 개발하다보면 스크롤 안에 버튼이 들어갈 경우가 종종.. 2020. 6. 30. [Unity] ScrollRect 에 붙은 Button처리하기 유니티의 UI컴포넌트를 많이 사용하는데, ScrollRect도 당연히 많이 사용하게 된다. ScrollRect로 리스트 구현할 때 간혹 리스트 안에 Button을 붙이는 경우가 생기는데 Button과 ScrollRect간에 이벤트가 공유되지 않아 원치 않은 상황이 생기게 된다. 예를 들면 Button위에서 Swipe을 하게 될 경우 이런경우 스크립으로 버튼오브젝트에 발생되는 터치 이벤트 정보를 스크롤렉트로 동일하게 잘 넘겨주면 되지만 ... 아무튼 귀찮다. 이번꺼는 버튼만 정리한 내용이다. using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.EventSystems; using Unit.. 2019. 5. 23. [Unity] EventSystem설정 터치 감도 조절 Unity로 안드로이드 앱을 개발하다보면 스크롤 안에 버튼이 들어갈 경우가 종종 있다. PC에서 테스트 할 때는 마우스로 잘 눌리던 버튼이 스마트 폰에 넣어서 테스트 해보면 간혹 잘 눌리지 않는 경우가 있다. 이럴때 EventSystem 설정을 바꿔줘야하는데 다음과 같이 세팅 하면 적당하다. private const float inchToCm = 2.54f; [SerializeField] private EventSystem eventSystem = null; [SerializeField] private float dragThresholdCM = 0.5f; //For drag Threshold private void SetDragThreshold() { if (eventSystem != null) { ev.. 2015. 10. 26. 이전 1 다음