示例#1
0
    private void OnMouseUp()
    {
        Debug.Log(m_mousePos + " " + Input.mousePosition);

        //if (UnityEngine.EventSystems.EventSystem.current.IsPointerOverGameObject())
        //{
        //    return;
        //}

        if (CameraExtension.IsPointerOverUIObject())
        {
            return;
        }

        if (15.0f > Vector3.Distance(Input.mousePosition, m_mousePos) && false == LandMineCheckImage.activeInHierarchy)
        {
            if (false == m_isSuccessCheck)
            {
                Uncover();
            }
        }

        m_touchTime      = 0;
        m_isTouching     = false;
        m_isSuccessCheck = false;
    }
示例#2
0
    private void OnMouseDown()
    {
        //if (UnityEngine.EventSystems.EventSystem.current.IsPointerOverGameObject())
        //{
        //    return;
        //}

        if (CameraExtension.IsPointerOverUIObject())
        {
            return;
        }

        m_mousePos   = Input.mousePosition;
        m_isTouching = true;
        Debug.Log(m_mousePos);
    }
示例#3
0
    public void Update()
    {
        //if (UnityEngine.EventSystems.EventSystem.current.IsPointerOverGameObject())
        //{
        //    return;
        //}

        if (CameraExtension.IsPointerOverUIObject())
        {
            return;
        }

        if (Input.GetMouseButtonDown(0))
        {
            m_oldPos    = transform.position;
            m_panOrigin = Camera.main.ScreenToViewportPoint(Input.mousePosition);
        }

        if (Input.GetMouseButton(0))
        {
            Vector3 pos = Camera.main.ScreenToViewportPoint(Input.mousePosition) - m_panOrigin;
            transform.position = m_oldPos + -1 * pos * m_panSpeed;

            m_totalMoveDistance += Vector3.Distance(transform.position, m_oldPos);

            if (20.0f < m_totalMoveDistance)
            {
                m_isDragging = true;
            }
        }

        if (Input.GetMouseButtonUp(0))
        {
            m_totalMoveDistance = 0.0f;
            m_isDragging        = false;
        }
    }