Exemplo n.º 1
0
    private const float m_CatchTime   = 0.2f;//500msec

    public void TapDown(ref RaycastHit2D hit)
    {
        m_State = TouchControlState.Click;

        if (Target != null)
        {
            Target.MouseDown();
        }
    }
Exemplo n.º 2
0
    public void TapDown(ref RaycastHit2D hit)
    {
        m_State = TouchControlState.Click;

        if (Target != null)
        {
            Target.MouseDown();
        }
    }
Exemplo n.º 3
0
    void Update()
    {
        if (m_State != TouchControlState.Free)
        {
            m_TapTime += Time.deltaTime;
        }

        if (m_State == TouchControlState.Click && m_TapTime >= m_CatchTime)
        {
            Debug.Log("DragEnter");
            m_State = TouchControlState.DragEnter;
            Target.DragEnter();
        }
    }
Exemplo n.º 4
0
    public void TapUp(ref RaycastHit2D hit)
    {
        if (m_State == TouchControlState.Click)
        {
            if (Target != null)
            {
                Target.Click();
            }
        }
        else if (m_State == TouchControlState.DragEnter)
        {
            Debug.Log("DragDrop");
            if (Target != null)
            {
                Target.DragDrop();
            }
        }

        m_State   = TouchControlState.Free;
        m_TapTime = 0.0f;
    }
Exemplo n.º 5
0
    public void TapUp(ref RaycastHit2D hit)
    {
        if (m_State == TouchControlState.Click)
        {
            if (Target != null)
            {
                Target.Click();
            }
        }
        else if (m_State == TouchControlState.DragEnter)
        {
            Debug.Log("DragDrop");
            if (Target != null)
            {
                Target.DragDrop();
            }
        }

        m_State = TouchControlState.Free;
        m_TapTime = 0.0f;
    }
Exemplo n.º 6
0
    void Update()
    {
        if (m_State != TouchControlState.Free)
        {
            m_TapTime += Time.deltaTime;
        }

        if (m_State == TouchControlState.Click && m_TapTime >= m_CatchTime)
        {
            Debug.Log("DragEnter");
            m_State = TouchControlState.DragEnter;
            Target.DragEnter();
        }
    }