Invoke(“方法名”,间隔时间)//每隔多少时间执行一次某方法
InvokeRepeating("printMessage",2f,3f);//2s后调用一次每隔3三调用一次
所以说写在void start()函数里的InvokeRepeating("printMessage",2f,3f);方法和写在void update()的Invoke()方法效果可能一样
Invoke(“方法名”,间隔时间)//每隔多少时间执行一次某方法
InvokeRepeating("printMessage",2f,3f);//2s后调用一次每隔3三调用一次
所以说写在void start()函数里的InvokeRepeating("printMessage",2f,3f);方法和写在void update()的Invoke()方法效果可能一样