unity Click to drag

Does this code changed to drag the way should be how to write it puzzled me for a long time, there is no one can help me to improve my, thank you------------------------------------------------------------------------------------------------------------------------------------------------------

private void ClickSet()
	{
		bool dianji = false;
		if (Input.GetButtonDown("Fire1") && HOTween.GetTweenInfos() == null)     
		{
			Destroy(_currentTime);
		  
			RaycastHit2D hitinfo = Physics2D.Raycast(Camera.main.ScreenToWorldPoint(Input.mousePosition), Vector2.zero);
			if (hitinfo.transform != null)
			{
				if (click1 == null) click1 = hitinfo.transform.gameObject;
				else {
					click2 = hitinfo.transform.gameObject;
					dianji = true;
				}
				_currentTime = GameObject.Instantiate(xuanze, new Vector3(hitinfo.transform.gameObject.transform.position.x,
					hitinfo.transform.gameObject.transform.position.y, -1), transform.rotation) as GameObject;
				if (dianji)
				{
					Vector3 distance = click1.transform.position - click2.transform.position;   
					if (Mathf.Abs(distance.x) <= 1 && Mathf.Abs(distance.y) <= 1)               
					{
						if (!qiehuan)
						{
							if (distance.x != 0 && distance.y != 0)
							{
								Destroy(_currentTime);
								click1 = null;
								click2 = null;
								return;
							}
						}
						JiaoHuanAnimation(click1.transform, click2.transform);         
						JiaoHuan(click1, click2, ref game);                     
					}
					else
					{
						click1 = null;
						click2 = null;
					}
					Destroy(_currentTime);
				}
			}
		}
	}

void OnMouseDown()
{
yourGameobject.transform.parent = Player.transform;
}
void OnMouseUp()
{
yourGameobject.transform.parent = null;
}