iOS 游戏开始时的输入延迟
当我在设备上运行 iOS 游戏时,从开始起大约一分钟,输入会出现延迟:当我触摸屏幕某处时,游戏仅在 2 到 3 秒后才识别该触摸;加速度计还显示 3 秒前的当前方向!
我知道这不是我的编码,因为在第一分钟(大约)之后,游戏开始正常运行,实时识别输入。
我怀疑这也与我的游戏运行缓慢有关,但我找不到原因。是否存在可能导致延迟的一般情况,或者可能是我的代码特有的情况?
When I run my iOS game on a device, for a minute from the start approximately there is a delay in input: when I touch the screen somewhere, the game recognizes that touch only after 2 to 3 seconds; the accelerometer also shows the current orientation from 3 seconds ago!
I know it's not my coding, because after the first minute (approximately), the game starts behaving correctly, with input recognized at real time.
I suspect it also has something to do with my game running slow, but I can't find what's causing it. Is there something general that could be causing the delay, or can it be something specific to my code?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
造成这种情况的原因有很多,但首先尝试使用 Instruments 来记录游戏的性能,您可以将游戏的实际开始推迟几秒钟,直到所有内容都正确加载。
很可能某个地方存在一个循环,它执行的迭代次数比预期的要多得多。
There is so many reasons for this, but as a start try using Instruments to record the performance of the game, and u could postpone the actual start of the game a few seconds till everything gets properly loaded.
it is very likely that there is a loop somewhere that is doing quite more iterations than it is supposed to.