unity 退出

if(Input.GetKey(KeyCode.Escape))
 {
  Application.Quit();
 }


放在update中就可以了

 

foreach(Touch touch in Input.touches)
		{
			if(touch.phase == TouchPhase.Began)
			{
							posstart =  touch.deltaPosition;
			}
			if(touch.phase == TouchPhase.Moved)
			{
						}
			if(touch.phase == TouchPhase.Ended)
			{
							posend = touch.deltaPosition;
								
			}
		}


android 触屏的触发事件 按下 移动和结束

你可能感兴趣的:(unity)