...
float time = 0;//记录已经经过多少秒
...
void Update() {
time += Time.deltaTime;
if (time >= 1f)//一秒
{
time = 0;
Debug.Log("测试update的调用 到了一秒");
}//
Debug.Log("测试update的调用 "+Time.deltaTime+ "/time:"+ time);
}//
...
[Unity]update每秒执行
最新推荐文章于 2024-04-03 14:53:40 发布