Convert Mouse Input to Touch Input

Hi guys. I have done a games for PC, but my target platform is Android/iOS. So the problem is how to convert Mouse Input to Touch Input. Below is my code. Can anyone help me? thanks in advance !

using UnityEngine;

using System.Collections;

public class DragDrop : MonoBehaviour
{
	private Vector3 screenPoint;
	private Vector3 offset;


	void OnMouseDown() 
	{ 
		screenPoint = Camera.main.WorldToScreenPoint(gameObject.transform.position);
		
		offset = gameObject.transform.position - Camera.main.ScreenToWorldPoint(new Vector3(Input.mousePosition.x, Input.mousePosition.y, screenPoint.z));
		
		Screen.showCursor = false;
		
		
	}
	
	void OnMouseDrag() 
	{ 
		Vector3 curScreenPoint = new Vector3(Input.mousePosition.x, Input.mousePosition.y, screenPoint.z);
		
		Vector3 curPosition = Camera.main.ScreenToWorldPoint(curScreenPoint) + offset;
		
		transform.position = curPosition;
		
	}
	void OnMouseUp()
		{
			Screen.showCursor=true;
	
	}
	}

You need to check the Input system. The parts you will need are basically touch count, Input.GetTouch, Touch and TouchPhase.

Check the examples and try to reproduce them. You’ll have to check for the Input.touchCount to see if there are touches, then get the current touches and check their phase. Your OnMouseDown and OnMouseUp will translate to TouchPhase.Began, TouchPhase.Ended (and so on) for each touch found.