方式一:利用Time.datelTime;
float timeBetween
float timer+=Time.daltaTime;
if(timer>=timeBetween)
{
timer=0f;
********代码*********}
方式二:利用Time.time
public float timeBetween;
float time;
if(Time.time-time>=timeBetween)
{
time=Time.time}
时间: 2025-01-08 00:16:48