【发布时间】:2017-03-23 17:24:03
【问题描述】:
我已将播放/暂停按钮设置为 gameLayer - 这里:How to prevent run SKAction on paused scene (after unpaused), texture of node not change after pause/unpause scene
一切正常,但我对后台应用程序无能为力。当我暂停 gameLayer 并且应用程序进入后台或锁定设备时,在应用程序进入前台后,游戏层会自动取消暂停。如何预防?
谢谢!
【问题讨论】:
-
只需在您的场景中侦听 UIApplicationDidBecomeActiveNotification 并采取适当的操作(暂停 gameLayer)。如果您仍然卡住,请告诉我,我会为您写一个答案。
-
我检查了苹果文档,发现只有
static let UIApplicationDidBecomeActive: NSNotification.Name,但我不知道如何准确地使用它。例子会很棒!谢谢!
标签: ios swift sprite-kit