iOS9升级SpriteKit显示不正常



我的应用程序被appstore拒绝,原因是在iOS9中运行不正常。

我下载了iOS9,似乎精灵纹理并没有按照我创建它们的顺序执行(这在以前的iOS版本中运行良好)。

-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event

众所周知的

for (UITouch *touch in touches) { .. }

循环不会检测到正确的节点。什么好主意吗?

我有一个问题与SKSpriteNodes和IOS9。精灵随机出现或不随机出现,所以我必须在所有精灵中设置zPosition属性,现在我可以看到所有精灵。

经过测试,似乎

选项
for (UITouch *touch in touches) { .. }

确实不再标识触摸位置的所有节点,而只标识最上面的节点。这对于使用它的游戏来说是不利的。相反,您只需要使用以下当前有效的方法:

UITouch *touch = [touches anyObject];
CGPoint location = [touch locationInNode:self];
NSArray *nodes = [self nodesAtPoint:location];
for (SKNode *node in nodes) { .. }

最新更新