我正在开展一个SpriteKit项目,当点击iAd时我很难暂停游戏,并且在iAd解散时取消暂停.主要问题是从ViewController暂停Scene,我知道如果我想暂停场景,Scene.m我应该使用代码
self.scene.view.paused = YES;
Run Code Online (Sandbox Code Playgroud)
但是此代码在ViewController中不起作用.
- (BOOL)bannerViewActionShouldBegin:(ADBannerView *)banner willLeaveApplication:(BOOL)willLeave
{
//pause game
}
- (void)bannerViewActionDidFinish:(ADBannerView *)banner
{
//unpause game
}
Run Code Online (Sandbox Code Playgroud)
我知道我想在上面的部分暂停游戏,但我很难找到资源知道如何执行此操作.任何帮助表示赞赏,谢谢.