很简单,直接上代码,解释都在注释中。
public class InputController:MonoBehaviour,IPointerDownHandler,IDragHandler,IPointerUpHandler
{
private float fingerActionSensitivity = Screen.width * 0.05f; //手指动作的敏感度,这里设定为 二十分之一的屏幕宽度.
private float fingerBeginX;
private float fingerBeginY;
private float fingerCurrentX;
private float fingerCurrentY;
private