Beispiel #1
0
 private void UF_UpdateUnLockDebugger()
 {
     if (IsActive)
     {
         return;
     }
     if (DeviceInput.UF_Down(0))
     {
         if (mPassIdx >= UnlockPassSqueue.Length)
         {
             IsActive = true;
             mPassIdx = 0;
             return;
         }
         else
         {
             int side = UF_ClickSideType(DeviceInput.UF_DownPosition(0));
             if (side == UnlockPassSqueue[mPassIdx])
             {
                 mPassIdx++;
             }
             else
             {
                 mPassIdx = 0;
             }
         }
     }
 }
Beispiel #2
0
        private void UpdateInput()
        {
            if (maskGraphicTrigger && DeviceInput.UF_Press(0))
            {
                if (uiCamera == null)
                {
                    return;
                }
                //停止复位
                m_IsResumePoint = false;

                if (!m_IsPress)
                {
                    m_SourceDragPos = DeviceInput.UF_DownPosition(0);
                    joyRoot.gameObject.transform.position = uiCamera.ScreenToWorldPoint(m_SourceDragPos);
                    m_IsPress = true;
                    UF_CallDelegateEvent(m_EventJoyPressDown);
                    UF_CallUnityEvent(m_UEventPressDown);
                }
                if (m_IsPress)
                {
                    m_TargetDragPos = DeviceInput.UF_PressPosition(0);
                    float dist   = Vector3.Distance(m_SourceDragPos, m_TargetDragPos);
                    float limitV = limtPointDistance * Screen.width / UIManager.FixedWidth;

                    if (dist > limitV)
                    {
                        m_TargetDragPos = m_SourceDragPos + (m_TargetDragPos - m_SourceDragPos).normalized * limitV;
                    }
                    if (joyPoint != null)
                    {
                        joyPoint.gameObject.transform.position = uiCamera.ScreenToWorldPoint(m_TargetDragPos);
                    }
//					float angle = 0;
                    Vector3 _moveVector = MathX.UF_Foward(m_SourceDragPos, m_TargetDragPos);
                    if (dist > deadZoom)
                    {
                        m_MoveForward = new Vector3(_moveVector.x, gravity, _moveVector.y).normalized;
                        UF_CallDelegateEvent(m_EventJoyPressMove);
                        UF_UpdateRotate(m_MoveForward);
                    }
                }
            }
            else
            {
                if (m_IsPress)
                {
                    m_IsPress = false;
                    UF_ResumePoint(); UF_UpdateRevertRoot();
                    UF_CallDelegateEvent(m_EventJoyPressUp);
                    UF_CallUnityEvent(m_UEventPressUp);
                }
            }
        }
Beispiel #3
0
        private void UF_OnInputDown()
        {
            Ray ray = UIManager.UICamera.ScreenPointToRay(DeviceInput.UF_DownPosition(0));

            if (Physics.Raycast(ray, out m_RayHit, 10000))
            {
                if (m_RayHit.collider.gameObject == this.gameObject)
                {
                    m_IsDrag        = true;
                    m_LastClickTime = System.Environment.TickCount;
                    m_SoundAngle    = gameObject.transform.localEulerAngles.y;

                    if (useClickAnimate)
                    {
                        UF_PlayAnimation(presetAnimation);
                    }
                }
            }
        }