コード例 #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();
        }
    }
コード例 #2
0
    public void TapDown(ref RaycastHit2D hit)
    {
        m_State = TouchControlState.Click;

        if (Target != null)
        {
            Target.MouseDown();
        }
    }
コード例 #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();
        }
    }
コード例 #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;
    }
コード例 #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;
    }
コード例 #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();
        }
    }