コード例 #1
0
        IEnumerator TryStartDragging(TouchInfo touchInfo)
        {
            yield return(new WaitForSeconds(_delay));

            if (touchInfo.Phase == TouchPhase.Ended)
            {
                _state = CheckerState.Failed;
                yield break;
            }
            _state = CheckerState.SuccessAndChecking;
            this.AddTrackingTouch(touchInfo);
            this.PrevMousePosition = touchInfo.Position;
            this.MousePosition     = Input.mousePosition;
        }
コード例 #2
0
        protected override void OnTouchesBegan(List <TouchInfo> touchInfos)
        {
            TouchInfo touchInfo = null;

            for (int i = 0; i < touchInfos.Count; ++i)
            {
                if (touchInfos[i].Phase != TouchPhase.Began || touchInfos[i].IsTouchedOnUI)
                {
                    continue;
                }
                touchInfo = touchInfos[i];
                break;
            }
            if (touchInfo == null)
            {
                return;
            }

            _state = CheckerState.Began;
            this.AddTrackingTouch(touchInfo);
            this.TouchPosition = touchInfos[0].Position;
            _moveDis           = 0;
        }
コード例 #3
0
 void StartTryDragging(TouchInfo touchInfo)
 {
     this.StopTryDragging();
     _tryStartDraggingCo = this.StartCoroutine(this.TryStartDragging(touchInfo));
 }