Пример #1
0
        void OnSceneDrag(DragGesture pDragGesture)
        {
            switch (pDragGesture.Phase)
            {
            case ContinuousGesturePhase.Started:
                isUGUITouched    = CCCollider.IsTouchCollider(CocoMainController.UICamera, m_UICollider);
                m_IsDragRotating = (Mathf.Abs(pDragGesture.DeltaMove.x) > Mathf.Abs(pDragGesture.DeltaMove.y));
                if (m_IsDragRotating)
                {
                    CCAction.Stop(m_CurRole.gameObject);
                }
                break;

            case ContinuousGesturePhase.Updated:
                if (!isUGUITouched && !LeanTween.isTweening(m_CurRole.gameObject))
                {
                    if (m_IsDragRotating)
                    {
                        m_CurRole.transform.Rotate(0, -pDragGesture.DeltaMove.x * 0.5f, 0);
                        if (dressGuide != null)
                        {
                            Destroy(dressGuide);
                        }
                    }
                    else
                    {
                        DragCamera(pDragGesture.DeltaMove.y);
                    }
                }
                break;

            case ContinuousGesturePhase.Ended:
                isUGUITouched = false;
                break;
            }
        }
        protected bool IsOutFrame()
        {
            RaycastHit hit = CCCollider.GetColliderHit(CocoMainController.UICamera, m_ScrollView.Collider, Input.mousePosition);

            return(hit.collider != null);
        }