Esempio n. 1
0
 private void PanUpdate(IGestureActionCallbackBase gesture)
 {
     //Debug.Log(gesture.State);
     lb_debug.text = gesture.State.ToString();
     if (gesture.State == EGestureActionCallbackState.Began)
     {
         //刚开始拖动
         this.cameraController.BeginDrag(gesture.FocuesPos);
     }
     else if (gesture.State == EGestureActionCallbackState.Executing)
     {
         this.cameraController.DragMove(gesture.FocuesPos);
     }
     else if (gesture.State == EGestureActionCallbackState.Ended)
     {
         this.cameraController.EndDrag();
     }
 }
Esempio n. 2
0
    private void ScaleUpdate(IGestureActionCallbackBase gesture)
    {
        //Debug.Log(gesture.State);
#if UNITY_EDITOR == false
        //this.lb_debug.text = gesture.State.ToString();
        if (gesture.State == EGestureActionCallbackState.Executing)
        {
            //默认2帧执行一次
            this.DelayScaleFrameCount++;
            if (this.DelayScaleFrameCount >= this.ScaleFrameCountInpector)
            {
                this.DelayScaleFrameCount = 0;
            }
            else
            {
                return;
            }
            var scrollValue = this.scaleGesture.ScaleMultiplier;
            this.lb_debug.text = scrollValue.ToString();
            var leftValue = scrollValue - 1;
            if (leftValue > 0)
            {
                this.Dir = -1f;
            }
            else if (leftValue < 0)
            {
                this.Dir = 1f;
            }
            this.cameraController.WheelScrolled(gesture.FocuesPos, this.Dir);
        }
        else if (gesture.State == EGestureActionCallbackState.Ended)
        {
            this.DelayScaleFrameCount = this.ScaleFrameCountInpector;
        }
#endif
    }