/// <summary>
        /// Cube滑动事件
        /// </summary>
        /// <param name="eventId"></param>
        /// <param name="isImmediately"></param>
        /// <param name="data"></param>
        private void OnCubeSlide(int eventId, bool isImmediately, IUserData data)
        {
            if (m_CanSlide)
            {
                return;
            }
            SlideData slideData = (SlideData)data;

            if (CheckSlideCondition(slideData.startPosition, slideData.endPosition))
            {
                m_CurrentItem    = GetHitCubeItem(slideData.transform);
                m_SlideDirection = GetSlideDirection(slideData.startPosition, slideData.endPosition);
                if (m_CurrentItem == null)
                {
                    //Debug.Log("hit is null!");
                    return;
                }
                m_TargetList.Clear();
                m_SlideTransforms.Clear();
                m_SlideOriginPositions.Clear();

                if (m_SlideDirection == Vector3.left)
                {
                    m_TargetList = GetTargetRowList(m_CurrentItem);
                    DoLeftOrder(m_TargetList);
                }
                else if (m_SlideDirection == Vector3.right)
                {
                    m_TargetList = GetTargetRowList(m_CurrentItem);
                    DoRightOrder(m_TargetList);
                }
                else if (m_SlideDirection == Vector3.forward)
                {
                    m_TargetList = GetTargetColomnList(m_CurrentItem);
                    DoUpOrder(m_TargetList);
                }
                else
                {
                    m_TargetList = GetTargetColomnList(m_CurrentItem);
                    DoDownOrder(m_TargetList);
                }
            }
        }
Example #2
0
 public override void OnRelease()
 {
     m_MoveData = null;
 }
Example #3
0
 public InputControl()
     : base("SlideControl", (int)BehaviourPriority.GF_Start, BehaviourGroup.Default.ToString())
 {
     m_MoveData = new SlideData();
 }