기본 콘텐츠로 건너뛰기

6월, 2017의 게시물 표시

[Unity3D] 모바일에서 스크롤바 안에 있는 버튼 클릭 문제

해당 씬 이벤트시스템에 아래 코드를 적용하면 된다. using UnityEngine; using UnityEngine.EventSystems; /// /// Sets the drag threshold for an EventSystem as a physical size based on DPI. /// public class PhysicalDragThreshold : MonoBehaviour {  private const float inchToCm = 2.54f;  [SerializeField]  private EventSystem eventSystem = null;  [SerializeField]  private float dragThresholdCM = 0.5f;  void Start ()  {   if (eventSystem == null)   {    eventSystem = GetComponent();   }   SetDragThreshold();  }  private void SetDragThreshold()  {   if (eventSystem != null)   {    eventSystem.pixelDragThreshold = (int)(_dragThresholdCM * Screen .DPI / inchToCm);   }  } }