其他分享
首页 > 其他分享> > unityAPI实验(一)

unityAPI实验(一)

作者:互联网


 - void FixedUpdate(){        
 - 	AddGravity();       
   	if(Input.GetKey(KeyCode.Space)){           
   		move.y=Mathf.SmoothDamp(0,1,ref speed,0.1f);           
   		Debug.Log("1");            
   		Debug.Log(move.y);        
   		}       
   	if(Input.GetKeyDown(KeyCode.Space)){            
   		Debug.Log("2");    
   	}        
   	x=move.y;        
   	cha.Move(move);    
   }

结果

结果可看出
Input.GetKey()按下一直为true
Input.GetKeyDown()按下一瞬间为true
谁来,将海 发布了4 篇原创文章 · 获赞 0 · 访问量 73 私信 关注

标签:Log,Space,move,GetKey,实验,unityAPI,Debug,Input
来源: https://blog.csdn.net/qq_43262525/article/details/104428348