SKScene -update
的文档如下:
“当前系统时间”到底是什么?除了通过 SKScene -update
之外,我该如何获取它?
我试过 CFAbsoluteTimeGetCurrent()
,但显然是这样
Returns the current system absolute time[, which is] is measured in seconds relative to the absolute reference date of Jan 1 2001 00:00:00 GMT.
并且与“当前系统时间”不同,根据我的测试,“当前系统时间”的值比“当前绝对时间”小几个数量级。
最佳答案
将 currentTime 从 update: 分配给一个 ivar 然后你就可以在当前帧的任何地方使用它。请注意,当处理帧时时间在流逝,您应该只使用当前帧的引用时间传递给更新:整个帧。
关于time - 你如何获得 "current system time"?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24836902/