Unity 更改游戏拖动阈值

using UnityEngine;
using UnityEngine.EventSystems;

public class DragThresholdUtil : MonoBehaviour
{
    // Start is called before the first frame update
    void Start()
    {
        int defaultDrayTheshold = EventSystem.current.pixelDragThreshold;
        EventSystem.current.pixelDragThreshold = Mathf.Max(defaultDrayTheshold, (int)(defaultDrayTheshold * Screen.dpi / 160f));
    }
}

 

posted @ 2020-05-21 11:29  三里路异乡客  阅读(531)  评论(0编辑  收藏  举报