unity mouse simulate touch code example
Example 1: disable mouse unity
Cursor.lockState = CursorLockMode.locked;
Cursor.visible = false;
Example 2: unity mobile touch input
void MobileController(){
if (Input.touchCount > 0)
{
theTouch = Input.GetTouch(0);
if ((theTouch.phase == TouchPhase.Began || theTouch.phase == TouchPhase.Stationary
|| theTouch.phase == TouchPhase.Moved) && isGrounded)
{
myRigidbody.AddForce(Vector3.up * (jumpPower * myRigidbody.mass * myRigidbody.gravityScale * 10.0f));
myAudioPlayer.PlayOneShot(jump);
isGrounded = false;
}
}
}