Beispiel #1
0
        public static float GetPinch()
        {
            if (AppManager.IsEditor && !AppManager.IsUnityRemote)
            {
                return(-Input.GetAxis("Mouse ScrollWheel"));
            }

            var deltaDistance = CommonTouch.GetDeltaTouchesDistance();
            var value         = deltaDistance / 1000f;

            value = Mathf.Clamp(value, -1f, 1f);

            return(value);
        }
Beispiel #2
0
        public static float GetInputV()
        {
            if (AppManager.IsEditor && !AppManager.IsUnityRemote)
            {
                return(Input.GetAxis("Vertical"));
            }

            if (CommonTouch.GetPhase() != CommonTouch.TouchPhase.SingleMoved)
            {
                return(0f);
            }

            var deltaPos = CommonTouch.Get1stDeltaPosition();
            var value    = deltaPos.y * AppManager.ScreenDragCoefficient;

            value = Mathf.Clamp(value, -5f, 5f);

            return(value);
        }
Beispiel #3
0
 public static Vector3 GetDragAmount()
 {
     return(CommonTouch.Get1stDeltaPosition());
 }