private float touchTime;//记录长按的时间
private boll newTouch;
if(Input.GetMouseButton(0))//如果长按{
Ray ray=Camera.main.ScreenPointToRay(InputmousePosition};
RaycastHit hitInfo;
if(PhysicsRaycasr(ray,out hitInfo)){
if(Input.touchCount==1){
Touch touch=Input.GetTouch(0);
if(touch.phase==Began){newTouch=true;touchTime=Time.time;}
else if(touch.phase==TouchPhase.Stationary)//按住没有动
if(newTouch=true&&Time.time-touchTime>1f)//认为是长按
newTouch=false;
Destory(hitInfo.collider.gameObject);}
else{neTouch=false;}}