해당 씬 이벤트시스템에 아래 코드를 적용하면 된다.
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);
}
}
}
댓글