...{} 2、如果没有必要每帧都处理,则可以每隔几帧处理一次void Update(){ if(Time.frameCount%6==0) { DoSomething(); }} 3、定时重复调用可以使用InvokeRepeating函数实现,比如,启动0.5秒后每隔1秒执行一次 DoSomeThing 函数:void Start(){InvokeRepeating("DoSomeThing", 0.5f, 1...
... 1. function Update() { if(Time.frameCount % 5 == 0){ DoSomeThing(); } } 2. 定时重复处理用 InvokeRepeating 函数实现比如,启动0.5秒后每隔1秒执行一次 DoSomeThing 函数:1. function Start() { InvokeRepeating(“DoSomeThing”, 0.5,...
...){10. if(Time.frameCount%6==0){11. DoSomething();12. }13. }14. /**15. 2---定时重复调用可以使用InvokeRepeating函数实现,比如,启动0.5秒后每隔1秒执行一次DoSomeThing 函数16. */17. void Start()18. {19. InvokeRepeating("DoSomeThin...