private void OnMouseUp() { m_UpPos = Input.mousePosition; if (null == m_TouchDropEventHandler) { return; } // end if TouchDropEventArgs args = new TouchDropEventArgs(m_DownPos, m_UpPos); m_TouchDropEventHandler(this, args); }
} // end Update private void OnTouchDropEvent(object sender, TouchDropEventArgs args) { if (!Global.Interactable || m_View.IsPlayingAnimation) { return; } // end if Vector3 delta = args.UpPos - args.DownPos; if (delta == Vector3.zero) { return; } // end if if (Mathf.Abs(delta.x) > Mathf.Abs(delta.y)) { if (delta.x > 0) { m_Model.ToRight(); } else { m_Model.ToLeft(); }// end if m_View.PlayMoveAnimation(m_Model.NodeMatrix); } else { if (delta.y > 0) { m_Model.ToUp(); } else { m_Model.ToDown(); } // end if m_View.PlayMoveAnimation(m_Model.NodeMatrix); } // end if } // end OnTouchDropEvent