protected virtual void OnDragDropStart ()
{
// Automatically disable the scroll view
if (mDragScrollView != null) mDragScrollView.enabled = false;
// Disable the collider so that it doesn't intercept events
if (mCollider != null) mCollider.enabled = false;
mTouchID = UICamera.currentTouchID;
mParent = mTrans.parent;
mRoot = NGUITools.FindInParents<UIRoot>(mParent);
mGrid = NGUITools.FindInParents<UIGrid>(mParent);
mTable = NGUITools.FindInParents<UITable>(mParent);
// Re-parent the item
if (UIDragDropRoot.root != null)
mTrans.parent = UIDragDropRoot.root;
Vector3 pos = mTrans.localPosition;
pos.z = 0f;
mTrans.localPosition = pos;
TweenPosition tp = GetComponent<TweenPosition>();
if (tp != null) tp.enabled = false;
SpringPosition sp = GetComponent<SpringPosition>();
if (sp != null) sp.enabled = false;
// Notify the widgets that the parent has changed
NGUITools.MarkParentAsChanged(gameObject);
if (mTable != null) mTable.repositionNow = true;
if (mGrid != null) mGrid.repositionNow = true;
}