var old_y:float=0; var new_y:float; var max_y:float=0; var min_y:float=0; var d_y:float=0; function Update () { new_y=Input.acceleration.y; d_y=new_y-old_y; old_y=new_y; if(Input.GetKey(KeyCode.Escape)){ Application.Quit(); } } var i:int; function OnGUI(){ GUI.Label(Rect(100,100,100,100),"g:"+Input.acceleration+"d_y:"+d_y); GUI.Label(Rect(100,210,100,100),"i:"+i); if(d_y>2){ i++; iPhoneUtils.Vibrate(); //手机的震动效果 } }
by: 发表于:2017-10-11 09:34:22 顶(0) | 踩(0) 回复
??
回复评论