private const float m_CatchTime = 0.2f;//500msec public void TapDown(ref RaycastHit2D hit) { m_State = TouchControlState.Click; if (Target != null) { Target.MouseDown(); } }
public void TapDown(ref RaycastHit2D hit) { m_State = TouchControlState.Click; if (Target != null) { Target.MouseDown(); } }
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(); } }
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; }