我正在开发一个spritekit游戏,大多数节点/精灵都是自己处理用户输入(/touches)的。当我想要执行特定的动画时,能够在游戏中执行[self setUserInteractionEnabled:NO]来禁用所有这些都是很棒的,但是这个特定的解决方案不起作用。
是否可以在不更改每个精灵中的userInteractionEnabled设置的情况下全局禁用用户输入?
发布于 2016-05-10 04:32:11
是的你可以。以下是这方面的代码:
[[UIApplication sharedApplication] beginIgnoringInteractionEvents];// nested. set should be set during animations & transitions to ignore touch and other events对于禁用它,您可以使用:
[[UIApplication sharedApplication] endIgnoringInteractionEvents];https://stackoverflow.com/questions/37127595
复制相似问题